By: Nicolaus
Date: 2006-12-04
Time: 20:09
|
Nested TemplatesI have a sidebar in my design where I have blocks with different designs i.e. a Calendar, Archive Link, Login, etc.
These blocks can be assigned by the user in different sections i.e. Right Sidebar, Left Sidebar, Header, Sub Footer. I could not figure out, how I can merge different (dynamic) templates into my sections of the design. |
||||
By: Skrol29
Date: 2006-12-04
Time: 20:49
|
Re: Nested TemplatesHe you seen how subtemplates and subscripts work with TBS ?
There are online examples at the Examples page. |
||||
By: Nicolaus
Date: 2006-12-04
Time: 21:46
|
Re: Nested TemplatesYes I did, but how do I manage an "unknown" number and type of subtemplates into the main template? What do I'm not getting here?
|
||||
By: Skrol29
Date: 2006-12-04
Time: 21:56
|
Re: Nested TemplatesThe principle idea is this:
Since you have this, you can play with it in order to displatch the display of your widgets to different parts of your page (header/footer/...). I suggest that you use sub-blocks (parameter p1). |
||||
By: Nicolaus
Date: 2006-12-04
Time: 22:13
|
Re: Nested TemplatesThank you very much ... I have tried exactly this ... but now I'm running into the problem, that I need to keep conflicting variables global ...
What I was hoping for, was that I can "process" MergeBlock, assign the result to an array and use this array in the main template or the subtemplate representing the sidebars and other sections. Thanks for your input! |
||||
By: Nicolaus
Date: 2006-12-04
Time: 22:48
|
Re: Nested TemplatesHmm, I believe I found the solution ;-)
$TBS->Show(TBS_NOTHING) $RenderResult[BlockSection] = $TBS->Source; $RenderResult is a global array in my program. I keep testing, and it looks good so far :-) |
||||
By: TomH
Date: 2006-12-05
Time: 02:11
|
Re: Nested TemplatesNicolaus,
There is another approach to this as well (with a lot of help from Skrol29 to get it working) - in your user data incorporate the column and sequence data records to use when populating the main template. The actual content definition comes from the subtpl scripts also defined in the records See example here http://tomhenry.us/tbs3/ )the prototype CMS link there) In the php code I do something like...
The main layout template (html) looks something like...
In the above, the portion of the block def... <td class="[blk.category]">[blk.id;script=[blk.categurl];subtpl;block=table]</td> does the work putting each subtpl script in the correct location and the subtpl script itself what queries for the content. In the above, when the value of script=blk.categurl="module_contentquery.php" the subtpl code looks like (using TBS very nice "subquery" feature)...
And the html TEMPLATE using the query/subquery like this...
I hope that is clear enough - glad to help more if you want to try this. |