Forums / Developer / How to Override modules pagelayout

How to Override modules pagelayout

Author Message

Pierre Tissot

Monday 30 July 2007 7:31:34 am

Hi,

I have a site that need to present the shop and advance search with a different looks (each one with their own layout) than the default pagelayout.

Since they are modules and not nodes or classes I don't know how to make it. I try two approaches:

- I try the layout/set/(mypage_layout) but all the futher links of this pagelayout built with ezurl are reflecting the /layout/set/(mypage_layout).

- I check the sections match criteria, but we cannot associate a section to a module, so I don't have idea of how I can use this.

Are they other strategies? because none of those ones are suitable for me?

Thanks

PiR

Bruce Morrison

Monday 30 July 2007 5:00:00 pm

Hi Pierre

I've had a look at the source for content/advancedsearch (kernel/content/advancedsearch.php) and it appears that you will only beable to override based on the section.

if ( $searchSectionID != -1 )
{
    include_once( 'kernel/common/eztemplatedesignresource.php' );
    $res =& eZTemplateDesignResource::instance();
    $res->setKeys( array( array( 'section', $searchSectionID ) ) );
}

It appears that $searchSectionID can be set in the search form. I'm unsure if this effects the actual search.

You can check out the shop module views looking for the "$res =& eZTemplateDesignResource::instance();" settings and see what keys are set. It is these that the override systems checks against the match conditions.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Thiago Campos Viana

Wednesday 01 August 2007 5:53:35 pm

working around you can write in the pagelayout.tpl:

{if $module_result.uri|contains("advancedsearch")}
<!-- code for the advanced search layout -->
{elseif $module_result.uri|contains("shop")}
<!-- code for the shop layout -->
{else}
<!-- code for the site layout -->
{/if}

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

eZ debug

Timing: Jan 31 2025 01:18:03
Script start
Timing: Jan 31 2025 01:18:03
Module start 'content'
Timing: Jan 31 2025 01:18:03
Module end 'content'
Timing: Jan 31 2025 01:18:03
Script end

Main resources:

Total runtime0.1995 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 587.9531370.2891
Module start 'content' 0.00640.0113 958.24221,001.6563
Module end 'content' 0.01770.1817 1,959.89843,890.2109
Script end 0.1994  5,850.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00422.1037200.0002
Check MTime0.00140.6791200.0001
Mysql Total
Database connection0.00050.260610.0005
Mysqli_queries0.104752.47001410.0007
Looping result0.00140.71231390.0000
Template Total0.181490.910.1814
Template load0.00070.359310.0007
Template processing0.180790.542810.1807
Override
Cache load0.00050.253710.0005
Sytem overhead
Fetch class attribute can translate value0.00180.888110.0018
XML
Image XML parsing0.00020.120810.0002
General
dbfile0.00814.0778200.0004
String conversion0.00000.001930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs