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.