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.

eZ debug

Timing: Jan 31 2025 03:43:39
Script start
Timing: Jan 31 2025 03:43:39
Module start 'layout'
Timing: Jan 31 2025 03:43:39
Module start 'content'
Timing: Jan 31 2025 03:43:40
Module end 'content'
Timing: Jan 31 2025 03:43:40
Script end

Main resources:

Total runtime1.1121 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.1328151.2109
Module start 'layout' 0.00550.0042 739.3438220.6875
Module start 'content' 0.00971.1015 960.03134,449.4063
Module end 'content' 1.11120.0009 5,409.437511.8516
Script end 1.1121  5,421.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2927160.0002
Check MTime0.00120.1074160.0001
Mysql Total
Database connection0.00080.073310.0008
Mysqli_queries1.016191.3657570.0178
Looping result0.00060.0498550.0000
Template Total1.059595.320.5297
Template load0.00180.161820.0009
Template processing1.057795.105920.5288
Template load and register function0.00150.135010.0015
states
state_id_array0.00170.150410.0017
state_identifier_array0.00170.154620.0009
Override
Cache load0.00140.1283200.0001
Sytem overhead
Fetch class attribute can translate value0.00190.166420.0009
Fetch class attribute name0.00210.184750.0004
XML
Image XML parsing0.01421.276520.0071
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.01381.2424220.0006
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs