Pagelayouts and views

Author Message

Børge Warvik

Wednesday 08 November 2006 1:26:39 am

I'm working on a popup window. For that window I'm using a different pagelayot (popup_pagelayout.tpl). The layout is defined in layout.ini and is called popup.

The problem is that I don't want to use the same view as for the standard layout. In my override file I try to do this:

[full_article]
Source=node/view/full.tpl
MatchFile=full/article_popup.tpl
Subdir=templates
Match[class_identifier]=article
Match[layout]=popup

But this does not work! What do I have to do to make this work?

I know using <b>Match[layout]=popup</b> doesn't work, but it just illustrates what I want to do.

Thanks,
Børge

Martin Ulrich

Wednesday 08 November 2006 3:28:00 am

hi
I had the same problem. Solved it by:

[full_article]
Source=node/view/article_popup.tpl
MatchFile=article_popup.tpl
Subdir=templates
Match[class_identifier]=article

and call with
<a href={concat( "/content/view/article_popup/", $:node.parent.node_id, "/" )|ezurl}>
I think
<a href={concat( "/layout/set/popup/content/view/article_popup/", $:node.parent.node_id, "/" )|ezurl}>
should work as well.

it works, even article_popup.tpl doesnt exist really in that folder. ;-O

but I don't know wether this is a correct solution!

I'd like to know very much what more professional, not so chaos-man as I say to this.

may be use for something

Gruß :)

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Adolfo Barragán

Thursday 09 November 2006 10:26:45 am

If you wish use a specific pagelayout for articles, then you need overrido pagelayout.tpl, not full.tpl.

So, I think next will work:

[popup_article]  
Source=pagelayout.tpl  
MatchFile=popup_pagelayout.tpl  
Subdir=templates  
Match[class_identifier]=article 

[full_article]
Source=node/view/full.tpl  
MatchFile=full/article_popup.tpl  
Subdir=templates  
Match[class_identifier]=article

Regards
Adolfo Barragán

Marco Zinn

Thursday 09 November 2006 12:21:47 pm

Well, as you found out, you need to create a new layout and a new pagelayout.tpl for this layout.

I suggest, that you use a new "view mode" for your node, as Sepp also suggest.

Have a look at this for some background information: http://ez.no/doc/ez_publish/technical_manual/3_8/templates/template_basics/node_templates

But i don't think, that you will need to override anything for this. Just create a new template file called full_popup.tpl in the same directory as full.tpl and line.tpl

Then, in your template code, use this to open your popup layout with the popup view of the current node.

<a href={concat( "/layout/set/popup/content/view/full_popup/", $node.id, "/" )|ezurl}>

If this works, you will have a new viewmode called "full_popup", which works just the same as "full" or "line".

If this does not work (i didn't test it), you really would have to override the view templates. I'm not sure, how to do this the right way, maybe this will help you:
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_override_conditions/node_view_tpl
Search for "viewmode".

If you need your popup stuff cached, look here: http://ez.no/doc/ez_publish/technical_manual/3_8/reference/configuration_files/site_ini/contentsettings/cachedviewmodes

Marco
http://www.hyperroad-design.com

Børge Warvik

Tuesday 14 November 2006 4:58:55 am

Thanks for the answers. I kinda solved it by just fetching the node in the pagelayout. I know this is bad ;-), but it works for now.

I'll look into the solutions when I come across this problem again.

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 18 2025 18:28:37
Script start
Timing: Jan 18 2025 18:28:37
Module start 'layout'
Timing: Jan 18 2025 18:28:37
Module start 'content'
Timing: Jan 18 2025 18:28:38
Module end 'content'
Timing: Jan 18 2025 18:28:39
Script end

Main resources:

Total runtime1.0134 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.9063152.6250
Module start 'layout' 0.00630.0025 740.531339.4453
Module start 'content' 0.00881.0030 779.9766641.7109
Module end 'content' 1.01180.0016 1,421.687516.1719
Script end 1.0134  1,437.8594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3179160.0002
Check MTime0.00140.1363160.0001
Mysql Total
Database connection0.00130.128410.0013
Mysqli_queries0.946293.3692670.0141
Looping result0.00080.0754650.0000
Template Total0.969095.620.4845
Template load0.00240.233120.0012
Template processing0.966695.378020.4833
Template load and register function0.00010.012010.0001
states
state_id_array0.00230.230310.0023
state_identifier_array0.00190.188920.0010
Override
Cache load0.00190.1920520.0000
Sytem overhead
Fetch class attribute can translate value0.00070.064640.0002
Fetch class attribute name0.00120.116370.0002
XML
Image XML parsing0.00110.109940.0003
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00100.0972220.0000
String conversion0.00000.000840.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 31
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs