How would I create a Parser for this?
Posted: Wed Sep 06, 2006 9:08 am
Hey,
I'm am trying to create what will be called, for my CMS - Module Display Rules which will do exactly what they say on the Tin, - Display Rules for each module that will be 'plugged' into the Template 'sectors'. A table structure will probably help:
*--- id ---+--- sector ---+--- modname ---+--- section ---*
* 1 ---------- SC
* 2 ---------- S1 -------------- title --------------- 1
* 2 ---------- S2 -------------- menu ------------- 1
* 2 ---------- S3 -------------- poll --------------- 1
* -------------------------------------------------------------------*
The main template file ( main_template.html ) has Tags in it which are for each Sector - eg {SC} {S1} {S2} {S3} - SC stands for Sector Content which will be the requested module from the url ( index.php?mod=news )
Now what I would like to add onto the table above ( tcm_template ) are Display Rules, so the table structure will be something like this:
*--- id ---+--- sector ---+--- modname ---+--- section --- +---------------------------------- displayRule ------------------------------*
* 1 -------- SC
* 2 -------- S1 ------------ title -------------- 1 ----------- DISPLAY 'news' IN 'S1' IF 'S3' == 'poll'
* 2 -------- S2 ------------ menu ------------- 1 ----------- DISPLAY 'title IN 'S2' IF 'S1' == 'news
* 2 --------- S3 ----------- poll --------------- 1 -------- DISPLAY 'download' IN 'S3' IF 'S1' != 'title' && 'S2' == 'title'
* ----------------------------------------------------------------------------------------------------------------------------------------------------*
Something like that anyway. I do not know how I would parse the Display Rules ( DISPLAY 'news' IN 'S1' IF 'S3' == 'poll' )
Gah I'm the worse person to explain something so it probably makes zero sense
I'm am trying to create what will be called, for my CMS - Module Display Rules which will do exactly what they say on the Tin, - Display Rules for each module that will be 'plugged' into the Template 'sectors'. A table structure will probably help:
*--- id ---+--- sector ---+--- modname ---+--- section ---*
* 1 ---------- SC
* 2 ---------- S1 -------------- title --------------- 1
* 2 ---------- S2 -------------- menu ------------- 1
* 2 ---------- S3 -------------- poll --------------- 1
* -------------------------------------------------------------------*
The main template file ( main_template.html ) has Tags in it which are for each Sector - eg {SC} {S1} {S2} {S3} - SC stands for Sector Content which will be the requested module from the url ( index.php?mod=news )
Now what I would like to add onto the table above ( tcm_template ) are Display Rules, so the table structure will be something like this:
*--- id ---+--- sector ---+--- modname ---+--- section --- +---------------------------------- displayRule ------------------------------*
* 1 -------- SC
* 2 -------- S1 ------------ title -------------- 1 ----------- DISPLAY 'news' IN 'S1' IF 'S3' == 'poll'
* 2 -------- S2 ------------ menu ------------- 1 ----------- DISPLAY 'title IN 'S2' IF 'S1' == 'news
* 2 --------- S3 ----------- poll --------------- 1 -------- DISPLAY 'download' IN 'S3' IF 'S1' != 'title' && 'S2' == 'title'
* ----------------------------------------------------------------------------------------------------------------------------------------------------*
Something like that anyway. I do not know how I would parse the Display Rules ( DISPLAY 'news' IN 'S1' IF 'S3' == 'poll' )
Gah I'm the worse person to explain something so it probably makes zero sense