Forums / Setup & design / Problems with TemplateCompile

Problems with TemplateCompile

Author Message

Christian Johansen

Tuesday 28 March 2006 2:36:34 am

Hi, I have a site that's just ready to go live. I turn on all cahing and it works fine, except when I use templateCompile. For some reason it fails to resolve all overrides when enabling this option, resulting in some pages not looking right. I have this in most of my full-templates:

{include uri="design:sub_nav_menu.tpl" node_id=$node.parent_node_id url_alias=$node.url_alias view='line'}

Which fetches a template that loops through the children like this:

{*
 Display children in a left hand meny

 Input:
 $node_id - The node id of the node whose children should be listed
 $url_alias - An url alias to pass to the node view gui
 $sort_by - Array with sort_by parameters
*}
{default $node_id = 0
	 $url_alias = ''
	 $sort_by = array( 'name', false() )
         $view = 'line'
}
{let children=fetch(content, list, hash(parent_node_id, $node_id,
                                   sort_by, $sort_by ))}
{if gt($children|count, 0)}

    <div class="section menu">
     <ul>
{/if}
  {foreach $children as $child sequence array(alt,) as $class}
    {node_view_gui view=$view content_node=$child alt=$class url=$url_alias}

  {/foreach}
{if gt($children|count, 0)}

     </ul>
    </div>
{/if}
{/let}

This works fine for "line"-view, but by the time I get to the page that uses "nav_line"-view it looks messed up. Am I missing something here? Without compiling it works like a charm.

Łukasz Serwatka

Tuesday 28 March 2006 10:15:51 pm

Do you mean when view cache is enabled?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Christian Johansen

Wednesday 29 March 2006 3:48:21 am

No, it works fine with view cache and caching, but as soon as I enable templatecompile it messes up the overrides.

Siniša Šehović

Thursday 08 June 2006 5:57:10 am

Hi

I have the same problem.
After enable templatecompile I can't see images in articles.

S.

---
If at first you don't succeed, look in the trash for the instructions.

Nathalie Grimaud

Thursday 18 January 2007 2:30:35 am

Any news about this issue?
In my case, just like Christian when I set TemplateCompile = enabled all the override rules are lost.

J-A Eberhard

Thursday 18 January 2007 3:10:49 am

Salut Nathalie,

Could it be related to this?
http://issues.ez.no/IssueView.php?Id=9781&activeItem=3
Getting away the user sensitive cache-blocks in the pagelayout.tpl solved my templateCompile problem.

Open Source Solution Provider
Open-Net Ltd Switzerland
http://www.open-net.ch

Nathalie Grimaud

Thursday 18 January 2007 3:57:12 am

Hi J-A,

for me it's not related to cache-blocks because even if I remove all of them I still can't see my override rules applied.
The only solution I found is set TemplaceCache=disabled.
Nevertheless thanks a lot for your suggestion.

Nathalie

Xavier Dutoit

Thursday 18 January 2007 9:26:03 am

Hi,

What's you're version of ez ?

Enable the debug display and clear all the cache then reload your page. Any error/warning ?

X+

http://www.sydesy.com

Nathalie Grimaud

Friday 19 January 2007 12:10:53 am

Hi Xavier,

I use eZ 3.9.0

Here is the only php warning I've got:
<i>
Array to string conversion in c:\ezpublish\htdocs\var\mysite\cache\template\compiled\pagelayout-f602be58cf32ecd4128484dd11f4c1de.php on line 436 </i>(it's the second one in the following code)

if ( is_array( $cacheKeys ) )
    $cacheKeys = implode( '_', $cacheKeys ) . '_';
else
    $cacheKeys .= '_';

Some more details:
My settings are

[ContentSettings]
ViewCaching=enabled
[TemplateSettings]
TemplateCompile=enabled
TemplateCache=enabled
[OverrideSettings]
Cache=enabled

I use some cache-blocks in pagelayout

The only override rules that are not applied have this structure

[my_override_rule]
Source=my_default_template.tpl
MatchFile=my_override_template.tpl
Subdir=templates
Match[class_group]=5

The ones with Source=node/view/... work fine

Thanks for your help
Nathalie

eZ debug

Timing: Jan 18 2025 19:16:36
Script start
Timing: Jan 18 2025 19:16:36
Module start 'content'
Timing: Jan 18 2025 19:16:36
Module end 'content'
Timing: Jan 18 2025 19:16:36
Script end

Main resources:

Total runtime0.2935 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0125 588.8438180.8359
Module start 'content' 0.01250.0080 769.6797101.9922
Module end 'content' 0.02050.2729 871.6719531.3047
Script end 0.2934  1,402.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00421.4214200.0002
Check MTime0.00160.5405200.0001
Mysql Total
Database connection0.00270.935310.0027
Mysqli_queries0.196266.84131410.0014
Looping result0.00180.61311390.0000
Template Total0.272492.810.2724
Template load0.00080.270510.0008
Template processing0.271692.540810.2716
Override
Cache load0.00050.181710.0005
Sytem overhead
Fetch class attribute can translate value0.00090.300510.0009
XML
Image XML parsing0.00030.107610.0003
General
dbfile0.02257.6801200.0011
String conversion0.00000.003130.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