How to make / change a template in Pligg Beta 7.
Templates and their files (css, js and images) are now stored in a subfolder in the templates folder.
To start a new template, you can create a new template folder and copy all the files from one of the existing templates into your folder. Then open /template/tempates.tpl and add a line for your template. Then open your site in your browser and choose your template.
Pages are still opened via thier php file. Example login is still login.php. The template is called at the end of the file...
$main_smarty->assign('tpl_center', $the_template . '/login_center');
$main_smarty->display($the_template . '/generic_main.tpl');
This tells smarty to use the login_center.tpl file for the middle of the login page. Generic_main.tpl is used for any page that does not require special code like "onload".
Generic_main.tpl does the following...
includes the lang.conf file.
sets up some basic html layout.
includes head.tpl
starts
includes the tpl_center template (body.tpl)
Body.tpl does the following...
sets up some divs
includes the tpl_header template
more divs
includes the tpl_center template (login_center in this example)
more divs
includes the tpl_left_sidebar template (user panel stuff)
more divs
includes the tpl_right_sidebar template (about + misc links + categories)
you know what goes here
includes the tpl_footer template
To change the top of the page (logo + search box) you would modify header.tpl
To change the left sidebar (user panel) you would modify user_panel.tpl
To change the right sidebar (about + misc links + categories) you would modify sidebar.tpl
To change the bottom of the page (powered by pligg) you would modify footer.tpl
To change the center of specific pages. Most pages use the _center.tpl. Example the login page uses login_center.tpl and the register page uses register_center.tpl.
To change the way a story looks on the main page, the queued page or the story page, you'd modify link_summary.tpl. PHP code and smarty variables are set in /libs/link_summary.php.
The 2 Column sidebar, the body.tpl is different. Step 6 includes tpl_left_sidebar then immediately includes tpl_right_sidebar.
The variables like tpl_header are set in the /libs/smartyvariables.php file and should not be changed (you'll break other templates)






Linear Mode




