exponential.earth / exponential / documentation / building an ez publish site / the welcome page / creating and using a custom template
These documentation pages are no longer maintained. Please visit the new documentation site.
Because we are unsatisfied with the way our welcome page is displayed, we will create a custom template. We can instruct eZ publish to use a desired template each time a specific node is accessed.
Our welcome page contains information that should not present in the welcome text. The date, the creator of the article, "Tip a friend", and "Download PDF version of this page" should be hidden. Therefore we override the default template, display the introduction text, body text, and the image.
The following guide should take you through the necessary steps.
eZ publish will then generate a custom template that will be used instead of the standard template every time the specified node is accessed. The newly generated template file will be put in the "design/tscm/override/templates/" directory. Edit the newly generated file. You can either use the administration interface, by clicking on the edit icon for the desired template file (if the 'could not open file' warning popups up, you can safely ignore it), or use your favourite text editor. Put the following lines into the file:
<div class="pagetitle"> {attribute_view_gui attribute=$node.object.data_map.title} </div> <div class="imageright"> {attribute_view_gui attribute=$node.object.data_map.image} </div> {attribute_view_gui attribute=$node.object.data_map.intro} {attribute_view_gui attribute=$node.object.data_map.body}
This template code will simply extract the contents of the welcome object and display it in a nice way.
Raise the priority of this template to 1, and clear the override caches. The welcome page hides: the date, the creator of the article, "Tip a friend", and "Download PDF version of this page".
Comments
unable to create an override in 3.9
Chris Hubert
Saturday 28 July 2007 4:52:55 am
Only link to image shown instead of image itself
Roger Schmidt
Sunday 13 August 2006 2:15:59 am
This code is not showing the image:
Following template is automatically taken:
design/standard/templates/content/view/text_linked.tpl
Any hints?
eZ Publish version 3.8.3, Apache 1.3, PHP 4.4.3RC3-dev, WinXP Pro.
Thanks,
Roger
Image in 3.5.2
tagnet hopetalk
Friday 07 October 2005 11:43:17 am
Could anyone solve this problem,
I also used this
{attribute_view_gui attribute=$node.object.data_map.title}
and did'nt get title and then added data_text
{attribute_view_gui attribute=$node.object.data_map.title.data_text}
to get the title , Same way for image Iam using
{attribute_view_gui attribute=$node.object.data_map.resource_thumbnail}
but not getting the image.Is there any other combination to add at last inorder to get the image displayed.Please help me ASAP in this case.
Image doesn't display at all?
James Ashley
Wednesday 17 August 2005 3:29:08 am
Custom templates broken in 3.5.1 - fixed in 3.5.2
Jean Goffinet
Monday 25 April 2005 5:08:40 pm
Change siteaccess to tscm to make the template work
vidar bakke
Saturday 22 January 2005 12:36:27 am
Welcome Page
Edwin Brooks
Saturday 08 January 2005 12:53:23 pm
In full_view_welcome.tpl:
<div class="pagetitle">
{attribute_view_gui attribute=$node.object.data_map.title}
</div>
<div class="imageright">
{attribute_view_gui attribute=$node.object.data_map.image}
</div>
{attribute_view_gui attribute=$node.object.data_map.intro}
{attribute_view_gui attribute=$node.object.data_map.body}
Image floated right?
Faust Gertz
Tuesday 28 December 2004 9:28:34 pm
Image in the right position of the text
Nordine Tbahriti
Tuesday 07 December 2004 3:21:33 pm
To have the image in the right side of the text I put the closing tag </div> at the last line.
Finally!
Steve Brown
Friday 03 December 2004 5:36:07 pm
chmod -R a+rwx design
This allowed creation of an empty file without the 'permission denied' error message. I was not able to edit the empty file from within the administrative interface, however.
I've been following a printed version of the building.pdf file as well as the online version (allows for copy/paste). Apparently these are different, the online version being more up-to-date (but not current with version 3.4.4).
At this point, I wouldn't mind an explanation of the templates under /node/view/full and how the priorities work. Also explain the formatting commands in full_view_welcome. The way the commands were explained in the 'Hello world!' example was excellent. This style should be followed throughout the rest of the documentation (now that I've successfully set up my welcome page, I can look at the rest of the documentation!)
Thanks for the great work on 'Ez publish'!!!