Forums / Developer / custamisation of templates

custamisation of templates

Author Message

justin kazadi

Wednesday 19 March 2008 6:33:34 am

hello all,

i am using ez now.

I want to override the default template (article.tpl) by article_just.tpl . I had done this:

- open the file : \siteaccess\ezwebin_site\override.ini.append.php

- write this at the top of file :

[full_article]

Source=node/view/full.tpl

MatchFile=full/article_just.tpl

Subdir=templates

Match[class_identifier]=article

- save the file article_just.tpl in :

C:\wamp\www\prosite\site\extension\ezwebin\design\ezwebin\override\templates\full

but nothing special . what can i do?

and i don't know how to display:

-the author name

-the intro

-the body

for each instance of article.

plaese help me

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

André R.

Wednesday 19 March 2008 9:25:47 am

Did you remember to clear cache ( especially template override cache )?

If you still have problems it might be because you override a template that is already overridden, so you can use placement override instead.
The concept is simple, you place a template with the same name in another design that has higher priority then the one you override, this gives you the added benefit of keeping you own file in you own design (extension).

Design extension structure:

extension
- <my_extension>
-- design
--- <my_design>
-- settings
--- design.ini

extension/<my_extension>/settings/design.ini:

[ExtensionSettings]
DesignExtensions[]=<my_extension>

settings/siteaccess/<your_frontend_siteaccess>/site.ini*

[DesignSettings]
SiteDesign=<my_design>
AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base

Then place your article template in:
extension/<my_extension>/design/<my_design>/override/templates/full/article.tpl

Look in ezwebin/ezflow/ezdhtml extensions for more aspects of setting up a design extension.

For how to get the author info and such, look in the article template in:
extension/ezwebin/design/ezwebin/override/templates/full/article.tpl
or
extension/ezflow/design/ezflow/override/templates/full/article.tpl

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

justin kazadi

Thursday 20 March 2008 2:16:24 am

hello André R,

i have anderstand what you have said. But defore to use it i want to said that

In my Web site (home page) , I have links towards articles , frontpage , .... That i have

created , but on click it just the path (and url ) which changes, same the default template of article or frontpage is not called.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

André R.

Thursday 20 March 2008 7:11:16 am

How does the path look like?
What kind of object is on that path? (What kind of class?)
What template is being used?
Are you seeing any warnings / errors about template not found?
( If not, clear ALL cache and look again! )

Enable debug:
http://ez.no/developer/forum/install_configuration/how_to_disable_cache_during_development_period#msg161792

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

justin kazadi

Friday 21 March 2008 5:18:32 am

hello André R,

When i have insert this :

[TemplateSettings]
Debug=disabled
ShowXHTMLCode=disabled
ShowUsedTemplates=enabled
TemplateCompile=enabled
TemplateCache=disabled
DevelopmentMode=enabled

I see that the system use my template (article_just.tpl) but i have two errors on the path template like this:

Error: eZTemplate @ extension/ezwebin/design/ezwebin/templates/parts/path.tpl:3[2]

Unknown template variable 'module_result' in namespace ''

Error: eZTemplate:foreach

Missing/malformed array to iterate through.

but i not modified it (it's the default) . the path.tpl is :

<!-- Path content: START -->

<p>
{foreach $module_result.path as $path}

{if $path.url}

<a href={cond( is_set( $path.url_alias ), $path.url_alias,

$path.url )|ezurl}>{$path.text|wash}</a>

{else}

{$path.text|wash}

{/if}

{delimiter}/{/delimiter}

{/foreach}

</p>
<!-- Path content: END -->

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

justin kazadi

Friday 21 March 2008 6:48:06 am

hello A ndré R,

i have forget one things the path look like this :

http://localhost/webmastre/professionnel/index.php/ezwebin_site/EUROPE/SousEurope1/Nicolas-sarkozy-en-visite-a-kinshasa

the classe of objects :

EUROPE is a frontpage

SousEurope1 is a frontpage

Nicolas-sarkozy-en-visite-a-kinshasa is an article

i think that the link doesn't work

please help me

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

André R.

Sunday 23 March 2008 10:35:03 am

module_result is a variable defined in pagelayout.tpl and the included templates, my guess is that you are including the path.tpl file in your article_just.tpl file, but thats a node template ( or a content template if you will ), and module_result is not defined there.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom