Forums / Setup & design / pagelayout.tpl flexibility

pagelayout.tpl flexibility

Author Message

Neil Kanth

Thursday 30 December 2004 9:40:34 am

I have gathered that the <b>pagelayout.tpl</b> is the template that every other templates (override) are created from. These override templates modifies how the content will look in the original pagelayout.tpl.

My question is this, using css and xhtml how can I have <b>sections</b> be completely different from the original pagelayout.tpl, that is, being able to design specific sections in either 1,2 or 3 columns?

Thanks
Neil

Roy Bøhmer

Thursday 30 December 2004 5:14:56 pm

You have to make an override for the pagelayout.tpl in your override.ini.append-file. To make a different frontpage write something like this:

[frontpage]
Source=pagelayout.tpl
MatchFile=pagelayout_front.tpl
Subdir=
Match[node]=2

Offcourse you can make the Match-conditions on sections instead.

In your pagelayout.tpl (or override) just make sure you somewhere insert

{include uri="design:page_mainarea.tpl"}


in order to get the node-content in place.

Now you can use different css in the different pagelayouts, and get 1, 2 or 3 columns.

Good luck!

Roy

Neil Kanth

Wednesday 05 January 2005 7:45:27 am

I've created a section (MD)ID=5 and assigned it to a folder (MD)Node ID=82.
Made a copy of the original pagelayout.tpl, made my changes and renamed it pagelayout_md.tpl and uploaded it to design/pooran/override/templates.
I then created an entry into settings/siteaccess/pooran/override.ini.append.php -
---------------------
[MDfolder]
Source=pagelayout.tpl
MatchFile=pagelayout_md.tpl
Subdir=
Match[section]=5
-------------------------
When I cleared the cache and browsed to the MD folder link, I get a blank page and in the debug mode I get:
----------------------------------------------------------------------
Line (1) - Notice: eZTemplate: Loading template "node/view/full.tpl" with resource "design"
Line (2nd to last) - Notice: eZTemplate: Loading template "pagelayout.tpl" with resource "design"
Line (last): Warning: eZTemplate No template could be loaded for "pagelayout.tpl" using resource "design"
-------------------------------------------------------------------------
Please help me fix the problem.

Thanks
Neil

Paul Borgermans

Wednesday 05 January 2005 8:51:48 am

I think you cannot leave SubDir empty

try with

Subdir=templates

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Neil Kanth

Wednesday 05 January 2005 9:25:48 am

I made the change and i'm getting:
line (1) - Notice: Jan 05 2005 11:14:47
eZTemplate: Loading template "node/view/full.tpl" with resource "design"
-----------------------------
line (2nd to last_ - Notice: Jan 05 2005 11:14:47
design/pooran/override/templates/pagelayout_md.tpl, iso-8859-1
------------------
line (last) - Error: eZTemplate @ design/pooran/override/templates/pagelayout_md.tpl:12[0] Jan 05 2005 11:14:47
parser error @ design/pooran/override/templates/pagelayout_md.tpl:12[0]
Unterminated tag "" does not match tag "section"
------------------------------------
I made only cosmetic changes to the original pagelayout.tpl (pagelayout_md.tpl)

I hope this helps to fix the problem.

Thanks
Neil

Paul Borgermans

Wednesday 05 January 2005 9:50:42 am

OK,

There is more than cosmetic changes: there is a bug in your template. Could you post the first 15 lines of your pagelayout_md file?

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Neil Kanth

Wednesday 05 January 2005 10:19:27 am

I followed the documentation 'building an eZ publish site' and kept the following code, {* Include the "page_head.tpl" file. *}
{include uri="design:page_head.tpl"} in the <head></head>
of the template; this was removed and it worked correctly.

Thanks for your patience.
Neil

Neil Kanth

Thursday 06 January 2005 9:36:01 am

While overriding templates I have arrived at a roadblock.
The MD section (5)is linked to a corresponding (folder) node (76).
This section has its own frontpage or folder view and it works fine - achieved from -

[frontpage_md]
Source=pagelayout.tpl
MatchFile=frontpage_md.tpl
Subdir=templates
Match[section]=5

Could I continue in the same trend, creating override.ini(.append) file block for each additional override?

I used the following override block to have each article have its own article view or full view and didn't get the expected result.

[full_md]
Source=frontpage_md.tpl
MatchFile=full_view_md.tpl
Subdir=templates
Match[class]=2
Match[section]=5

I would like to have control of each individual template used in the section.

What have I done wrong?
-Neil

Paul Borgermans

Thursday 06 January 2005 9:40:33 am

Maybe the order in the override.ini.* file?

You must be sure that the most specific is at the beginning of an override file, so your template override for the section and folder class should be there before any other more general folder override.

Also make sured that the [full_md] is really uique in name.

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Jan Borsodi

Friday 07 January 2005 12:31:39 am

<quote>
Could I continue in the same trend, creating override.ini(.append) file block for each additional override?
</quote>

No this is not possible, the <i>Source</i> must refer to a non-override template file.

Your article override should probably look like:

[full_md]
Source=node/view/full.tpl
MatchFile=full_view_md.tpl
Subdir=templates
Match[class]=2
Match[section]=5

Allthough this only creates an override for your embedded article template and not the entire pagelayout.

If you need a different pagelayout for articles in section 5 you will need to do:

[pagelayout_full_md]
Source=pagelayout.tpl
MatchFile=pagelayout_article_md.tpl
Subdir=templates
Match[class]=2
Match[section]=5

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Neil Kanth

Friday 07 January 2005 11:47:49 am

How could I include subfolders within the MD root folder?
This is the block code that I used:

[pagelayout_folder_md]
Source=pagelayout.tpl
MatchFile=pagelayout_folder_md.tpl
Subdir=templates
Match[node]=82
Match[section]=5

and it only listed 'list' articles within the MD root folder, other nodes within the MD folder are 83,84,85 &86.

Thanks you very much
-Neil

Jan Borsodi

Thursday 13 January 2005 12:32:32 am

I'm not entirely sure what you are trying to do.
Your override match only concerns the site layout and not the listing of folders, articles etc.

All logic and listing is handled by the <em>node/view/full.tpl</em> template. Most likely you will need to create overrides for this template as well.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq