Path

ez.no / ezpublish / documentation / customization / tips & tricks / improve the pagelayout.tpl


Improve the pagelayout.tpl

These documentation pages are no longer maintained. Please visit the new documentation site.

In general all content is parsed through.

{$module_result.content}

From now on referred as mainresult.

We shouldn't try to produce some wrapping around the mainresult to show our custom content objects.

Many of may have wondered why the folders don't show up display in line view in the demo design.

This tutorial shows how to alter the content object output.

At current point my aim is to replace the output of $module_result.content

and make more custom for my needs

  • implementing the google navigator
  • making folders viewable in the mainresult

Now we create a line view for the content class 1. Create the file in /design/"sitedesign"/override/templates/node/view/line_class_1.tpl

{default content_version=$node.contentobject_version_object}

    <div class="listitem">

    <img src={"folder_open.gif"|ezimage} alt="" border="0" />

     <a href={concat('content/view/full/',$content_version.node_id)|ezurl}>{$content_version.name}</a>

    </div>

After that the folders still may not show up. Go to the in /design/"sitedesign"/override/templates/node/view/full_class_1.tpl and check the fetch function in this file. It should look similar to this.

{section name=Child loop=fetch('content','list',hash(parent_node_id,$node.node_id,limit,$page_limit,offset,$view_parameters.offset,sort_by,$node.sort_array))}

 

   {node_view_gui view=line content_node=$Child:item}

 

{/section}

Watch out for any exclude in the fetch. I usually prefer all content objects fetched. I also think this should we the way. There are maybe also considerations were you might exclude the some classes. For example when you have a dynamic menu that always displays the current children (class folder?). Who needs double information? I don't.

In the last step I would like to show you how modify the settings of the google navigator. Open template /design/standart/template/content/node/view/full.tpl and have a look at those lines. You might also want to copy the existing file to the proper override folder in the demo design.

$page_limit and $list_count are needed to get the google navigator working. We simply fetch all Children of the parent_node_id. We can limit the fetched children by settting page_limit to a differnet value.

{let page_limit=10

    list_count=and($with_children,fetch('content','list_count',hash(parent_node_id,$node.node_id)))}

 

{*after several lines of code later*}

 

{include name=navigator

        uri='design:navigator/google.tpl'

        page_uri=concat('/content/view','/full/',$node.node_id)

        item_count=$list_count

        view_parameters=$view_parameters

        item_limit=$page_limit}

As you can see the google navigator just needs very view input. Modify it to your needs.

Now we can imprlement the google navigator for example in the "full_class_1.tpl". This is the part the is reponsible to display all the children of a single content object. You will find a google navigator on top and on the bottom.

{default with_children=true()}

{let page_limit=15

    list_count=and($with_children,fetch('content','list_count',hash(parent_node_id,$node.node_id)))}

{default content_object=$node.object

        content_version=$node.contentobject_version_object

        node_name=$node.name}

<div class="block">

{attribute_view_gui attribute=$content_version.data_map.description}

</div>

{include name=navigator

        uri='design:navigator/google.tpl'

        page_uri=concat('/content/view','/full/',$node.node_id)

        item_count=$list_count

        view_parameters=$view_parameters

        item_limit=$page_limit}

{section show=$with_children}

 

{section name=Child loop=fetch('content','list',hash(parent_node_id,$node.node_id,limit,$page_limit,offset,$view_parameters.offset,sort_by,$node.sort_array))}

 

   {node_view_gui view=line content_node=$Child:item}

 

{/section}

 

{/section}

{include name=navigator

        uri='design:navigator/google.tpl'

        page_uri=concat('/content/view','/full/',$node.node_id)

        item_count=$list_count

        view_parameters=$view_parameters

        item_limit=$page_limit}

{/default}

{/let}

{/default}

It might be that the google Navigator breaks your sitedesign. Check and alter the /design/standart/template/navigation/google.tpl

{default name=ViewParameter

        left_max=5

        right_max=4}

See how this might look.

I might figure out more things in the future, feel free to edit and alter.

Comments

Contents

Customization

Access control
eZ publish API Documentation
Content structure
Custom design
Components
Tips & Tricks
    Debugging templates
    Javascript in templates
    Fetching current user
    Showing related objects
    Show which templates are used
    Fetching the ID of the parent
    One Article Folder
    Creating tree menus
    How can I use my own php script insid...
    Hiding attribute content
    Splitting an article over several pages
    Accessing section id in pagelayout
    List articles in folder
    Creating nice URLs
    Alt tag on images
    Improve the pagelayout.tpl
    Clean HTML tags
    Insert javascript call inside ezpub d...
    3rd party applications
    Fetch Function examples
    Display more than 15 items on your co...
    Including PHP files in templates
    Redirecting after content publishing
    HowTo see if article has an image
    Date and Time Formats
    Forms processing example: store user...
    Adjust Timezone
    Adding a Remove Button/Image
    Find the age in years for an object
    Editing, creating and removing conten...
    Indexing binary files with IFilters o...
Troubleshooting


Created

21/05/2003
3:50:35 pm
by Björn Dieding@xrow.de

Last updated

04/07/2003
5:09:05 pm
by Bård Farstad

Authors

Björn Dieding@xrow.de
message0815 student
Bård Farstad



This page is part of the eZ Publish documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.