structure / variables

Structure / variables, a forum discussion on Jojo CMS. Join us for more discussions on Structure / variables on our General Discussion forum.

Back to Forum Index : Back to General Discussion   RSS
Rosaline Rosaline

7 Mar 2008
Posts: 8

I'm happily editing and changing and developping my jojo testwebsite.

But some things are still very unclear for me.

If I take a look at for instance "template.tpl" I can make the looks of the site exactly how I want it by changing the html and the css, works great.
But where are for instance the variables set up? I mean I "use" $subnav, but i don't know where I can change it, or I can make new variables that I want to use. (btw/so, if i want to make a menu for a "subsubnav" how do I do that?)

Another thing (not that I need it but I like to understand): it includes the head.tpl, but where is that file? for me it's a bit magic ;)

Thanks,
Rosaline
Harvey

Core Developer

Harvey

7 Mar 2008
Posts: 327

The Smarty variables are defined in the PHP code. If you look at certain PHP files you will see this sort of thing happening often...
$smarty->assign('name', 'harvey');

Which creates a variable `$name` with the value "harvey".

Probably, the place you are wanting to look for setting your own variables is the global.php file of your theme.

If you are looking for cool things to do with the variables, check out the Smarty documentation at http://smarty.php.net.

Where do you find template files?

All template files come out of plugins or themes. On a fresh install, most of the templates can be found in plugins/jojo_core/templates/ as we try to treat the core code the same as any other.

We recommend you don't edit any of the templates in the main Jojo install - as we are hard at work tweaking and improving them. If you edit these files, you will most likely lose those changes come upgrade time. If you need to make changes to one of our supplied templates, an easy way to do this is to make a copy of the .tpl in your theme/templates/ folder. If you do this, Jojo will ignore the original and use your version instead.

Also, you may have guessed that stylesheets are handled similarly - all the css/style.css files from all plugins/themes are squashed into a single CSS file to save on file requests (with the CSS from the theme being given higher priority than all other plugins).

And likewise for images, if you don't like any of the default images, simply place your own replacement in yourtheme/images/ and this will be given priority.

You mention head.tpl, and that particular file is something we don't recommend tinkering with directly. If you want to insert your own scripts into the head, create your own template called templates/customhead.tpl and this will be inserted in the head for you. Useful for including your own scripts and CSS files if you need to.

Harvey.
Back to Forum Index : Back to General Discussion   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.