n00dles / DM_Matrix

The Matrix is an XML file based Database system for GetSimple 3.1
8 stars 7 forks source link

general questions #25

Closed outflux3 closed 12 years ago

outflux3 commented 12 years ago

Hi Mike, Just wanted to post a few general questions here as i'm almost done with setting up an application using matrix...

1.) how can I get text editor fields to output without escaped quotes

2.) what is the procedure to have a record become a page (i.e. if a single record is a blog entry, how to access that as a page) and how to template that;

3.) is there any way to pull an excerpt from a texteditor field.

Thanks!

-marc

n00dles commented 12 years ago

1) i'm using the same code for encoding as GS so to unencode text from the editors before outputting you will need to use

strip_decode($content)

2) This will be implemented using the routing table (_routes) and the slug field. I'll try and document it for you tonight when I get home and put it in the wiki.

3) There is nothing written yet but i'll be adding these sort of functions before we go live.

I just need to sort out the delete functions and we should be ready for a beta release and then a full release quickly after that.

outflux3 commented 12 years ago

Ok great - got the strip_decode working;

thanks for the help!

I will try to start contributing to the wiki once i have a solid grasp of the whole thing; I will have some code example and maybe there could be a place to store complete setups, like blogs, etc, with all of the tables, functions etc..

tablatronix commented 12 years ago

regarding get field functions, did you have anyhting in mind mike ?

I was thinking it would be nice to have DM_getField('name'); DM_printField('name'); functionality for templating.

2 ways i can think. Classic functions with an internal global var obvious issues, single table at a time, which is fine if you think of this as sql.

DM_use('tablename,'index?'); // called first to set a global tablespace, just like sql does for queries.
DM_useRecord('index'); // to select the record id to use
echo DM_getField('myfield');
DM_close(); // might be useful to unset to prevent undesired results in another query

or objectlike

$DM_record = new DM_table('tablename','index'); 
echo $DM_record->getField('fieldname');

or perhaps ever runtime functions based on table names

DM_get_tablename_field('fieldname'); // this probably isn't wise.

Obviously we need to select a table and a record so its a little different than normal sql queries, but better than doing selects just to get record fields. or passing the same parameters over and over to a function.