Deliver subtree specific code

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Jubilar
New Member
New Member
Posts: 5
Joined: Wed Nov 18, 2009 3:52 am

Deliver subtree specific code

Post by Jubilar »

Code: Select all

My page structure looks like this: 

Root Page
|
----------subtree one
|           |
|           ........
|
|
----------subtree two
|            |
|            .........
|
|
----------subtree three
             |
             ............
I have to send unique JavaScript code for every subtree. How can I archive this without creating a different template for each subtree?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Deliver subtree specific code

Post by calguy1000 »

Use the CGSimpleSmartyModule and something like:

{$cgsimple->get_root_alias('','root_alias')}
{if $root_alias == 'subtree1'}
{elseif $root_alias == 'subtree2'}
{elseif $root_alias == 'subtree3'}
{else}
{* ... *}
{/if}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “CMSMS Core”