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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.