Include templates in content

Author Message

paul bolger

Thursday 08 February 2007 6:54:31 pm

I have a large number of pages which need to include lists which are generated with a fetch function, with different parameters for each page. Is it possible to include a template within a folder object, or do I need to override pagelayout.tpl for each page concerned?

Or would I be better off taking a different approach entirely?

Paul Bolger

Paul Bolger

Børge Warvik

Friday 09 February 2007 2:17:47 am

If you want the lists to show on all your folder objects, then in the folder view just add it with the include operator.

If you need to show the list on some pages, then you just define the condition and check for it with an if-statement, and then include template if statement meets the condition you have defined.

Hope this helps

paul bolger

Sunday 11 February 2007 6:58:50 pm

Thanks Børge

I realise now that I need to do two things, and was hoping the same method would work for both. Having thought further I'd better give more detail on what I'd like to achieve.

Firstly: We have a 'current date' at the top of our pagelayout, which pulls the current server date. This links to a page which has some static information about the location of our town and the current time there. What I'm looking for is a method of including the currentdate operator in the content without having to define a custom tag for it. Is this possible?

Secondly: We have - or will have, when we finish cleaning and importing the data... - a large number of objects which contain information about local organisations. These objects have an attribute 'type' which allows them to be assigned to one or more categories such as 'school', 'government', 'not for profit' etc. Pages such as the one detailing schools in the area will have a template included which will generate a list of the objects which meet specific criteria, meaning the data for each organisation will only exist in the system in one place, and updating it will result in it being updated everywhere it is displayed.

I'm still pretty new to EzPublish so my first attempt at doing this involved overriding pagelayout for each page and including a template with the required criteria coded in. It now seems that a much better way to do this would be to define a custom tag with the criteria as a, or a number of, variables in a single template, and to define the selection criteria in the custom tag variables. Does this sound feasible?

paul bolger

Paul Bolger

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.