This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Template howto
expandshrink

Template howto

Template howto

Wednesday 23 July 2003 10:57:34 pm - 8 replies

This is the first time i'm trying to install EZP 3.1.1.
The site works fine, but i don't understand the template system.

Is there any howto on making a custom design?
I've tried to look at the demo site, but it's to advanced.

Can anyone please help me?

Cheers,
- Bjarte

Wednesday 23 July 2003 11:06:05 pm

There is quite some information in the documentation. Read the info at:
http://ez.no/developer/ez_publish...entation/customization/custom_design

--bård

Wednesday 23 July 2003 11:44:32 pm

I've read the info and the documentation, but i don't get any further. The pagelayout.tpl is ok, but i don't understand how to build the menus and views. I'm trying to copy the design i have today on bamboosh.com into EZP and not use frames...

Modified on Wednesday 23 July 2003 11:47:24 pm by Bjarte Lunde

Thursday 24 July 2003 12:10:51 am

You can make templates files (with .tpl extension) and put them in your /design/user/templates directory (if 'user' is your site directory).

Put the template-code and html in these files and include them from your pagelayout template, where you want them to appear, like this:

{include uri="design:your_template.tpl"}

For example, this is the code I use to display the latest 5 forum messages in the right column of the site I'm setting up:

<literate>
-------------------------------
<table width="120" border="0" cellpadding="5" cellspacing="0">
<tr>
<td bgcolor="#000000">
<b class="smalltitle">Last 5 messages</b><br>
{section name=Message loop=fetch( content, tree, hash(
parent_node_id, 73,
limit, 5,
sort_by, array( published, false() ),
class_filter_type, include,
class_filter_array, array( 7 ) ) ) }


<span class="menu"> &#8226; </span><a class="menu" href={concat( "/content/view/full/", $Message:item.node_id, "/" )|ezurl}>{$Message:item.name|wash}</a><br>

{/section}
</td>
</tr>
</table>
--------------------------
</literate>

Templates to view objects (nodes) should be stored in /design/user/overide/templates/ and initilized by editing the override.ini file. Take a look in the /settings/siteaccess/demo/ directory to see how it is set up and locate the templates in /design/demo/override/templates/. Try editing the template files and see how it is displayed on the demo site.

Remember to turn off view cachin in site.ini (search for "ViewCaching" and set it to disabled), or else you won't see your changes.

Hope this help you getting started.

Modified on Thursday 24 July 2003 12:16:53 am by Kjerand Pedersen

Friday 25 July 2003 1:12:26 am

Thanks for the informative reply, Kjerand! I'm also trying to figure this template system out, here are two more questions..

Is there any way to override design/user/templates/pagelayout.tpl so that it will not be overwritten when upgrading to the next version?

Which one is the recommended practice here: a) start hacking the design/user directory or b) create your own design/mydesign directory?

Friday 25 July 2003 8:39:35 am

Hi Pirkka.

I would make my own custom design folder.

Then you would use design/mydesign/templates/pagelayout.tpl

Regards Bjørn

Friday 25 July 2003 2:05:46 pm

Simply put pagelayout.tpl in the /design/user/override/templates directory (if user is your site dir) to override the pagelayout file.

Friday 25 July 2003 2:17:18 pm

Hello.. Finally i've startet to understand how to customize the templates. But when i started on the forum template, my menu vanish... Why?

By the way; thanx for all help!
Who's in on starting a ez tutorial project?

Tuesday 29 July 2003 1:23:43 am

>Simply put pagelayout.tpl in the /design/user/override/templates
>directory (if user is your site dir) to override the pagelayout file.

This doesn't seem to work with 3.1's override.ini mechanism, while it worked with version 3.0 (correct me if I'm wrong!!!).

How do I configure override.ini to override a template for ALL nodes, classes and sections?

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from