Questions from a newbie (?)

Author Message

Alexis F

Monday 05 October 2009 9:58:16 am

First at all, hello everyone, and please forgive my bad english.

I've been working alone with ezpublish for more than a month, but i still have problems anderstanding basics.

I have a few questions, and I hope you can answer me.

I use ezpublish 4.2 with plain_site installation (4.1.3 before)

I know modx very well, if it can help.

1) What is the difference of fonctionning between modules, sitesaccess and views with urls?

2) How to use other modules than content ? Using urls like http://www.mysite.com/index.php/module_name/view_name

What are exactly views ? I have a "view" view in content module, but also a "search", "action" or "tipafriend" views.

3) How to make work this better, in the attented way :

Let's say I have http://www.mysite.com/path-to-dev-site/index.php

I can access a content page (ie. node ID 42), using the following urls (they work, fine)

http://www.mysite.com/path-to-dev-site/index.php/siteaccessname/Section_object_name/Content_object_name
Or
http://www.mysite.com/path-to-dev-site/index.php/content/view/full/42/ (with fallback to default siteaccess)
Or
http://www.mysite.com/path-to-dev-site/index.php/siteaccessname/content/view/full/42/

So, If i anderstand well, url 1&2 are "pointing" to url 3 , right ?

I currently work the following way.

In my design/siteaccess/templares/pagelayout.tpl, I use the following (sample) code :

{include uri='design:chunks/header.tpl'}

{if $module_result.content_info.class_identifier|eq('customsection')}
    {include uri='design/siteaccessname/templates/customsection.tpl'} 
{elseif $module_result.content_info.class_identifier|eq('customcontent')}
    {include uri='design/siteaccessname/templates/customcontent.tpl'} 
{else}
    {include uri='design/siteaccessname/templates/404.tpl'} 
{/if}

{include uri='design:chunks/footer.tpl'}

* btw, using {include uri='design:filename.tpl'} doesn't work everytime. Anyone know what I'm doing wrong ? *

And in "customsection.tpl" and "customcontent.tpl", I basicaly do :

{def $node=fetch(content,node,hash(node_id,$module_result.node_id))}
<h1>Title of the node : {attribute_view_gui attribute=$node.data_map.title}</h1>
<p>Text of the node : {$node.data_map.body.data_text}</p>

This is basically "php", with ezpublish template language.

4) I can't override templates.

Let's say i want to override /content/search.tpl

In the administration, I go to design => models.

I click on the file link, I select the right siteaccess and create a new override (empty extention).

I check the override.ini.append.php in my siteaccess:

[search]
Source=content/search.tpl
MatchFile=search.tpl
Subdir=templates

Then I go to
http://www.mysite.com/path-to-dev-site/index.php/content/search
or
http://www.mysite.com/path-to-dev-site/index.php/siteaccessname/content/search

But with debug, I still have

eZTemplate: Loading template "content/search.tpl" with resource "design"
Notice: 	Oct 05 2009 16:40:11
design/base/templates/content/search.tpl, utf-8

Finally, I want to have a poll and subscription on the website.
I followed the tutorial : http://85.19.74.108/developer/articles/how_to_create_ez_publish_forms/

But when I try to preview the contentnode having the subscription content class,
http://www.mysite.com/path-to-dev-site/index.php/content/view/full/42/

The final template loaded is aways design/standard/templates/content/collectedinfo_validation.tpl

I know there are lot's of thing asked here, but I'ld really enjoy have a few more information.

Thank you

- Stol

Gabriel Finkelstein

Friday 09 October 2009 11:05:02 am

You should take a look at these articles:
1 & 2)
http://ez.no/doc/ez_publish/technical_manual/4_x/concepts_and_basics/modules_and_views
http://ez.no/doc/ez_publish/technical_manual/4_x/concepts_and_basics/configuration/site_management
http://ez.no/doc/ez_publish/technical_manual/4_x/concepts_and_basics/url_translation

3) What are you trying to do there? eZ Publish automatically shows the content ( eg Article, Folder, etc) you are viewing, depending on the url. It calls the template that belongs to that class (override/templates/full/article.tpl and override/templates/full/folder.tpl). It also handles 404 errors automatically. All you have to do is add the following in the main part of your pagelayout.tpl:

{$module_result.content}

(Take a look at the default pagelayout.tpl)

4) If you want to override a template located in design/base/templates or design/standard/templates, you have to create a template with the same name under design/siteaccess/templates. And you don't need to add anything in override.ini.append.php.

5) For the form, you first have to create a template in design/siteaccess/override/templates/full and add an entry in override.ini.append.php (take a look at this http://85.19.74.108/developer/articles/how_to_create_ez_publish_forms/form_template_creation_and_modification and the last part of http://85.19.74.108/developer/articles/how_to_create_ez_publish_forms/form_configuration_settings )

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

eZ debug

Timing: Jan 18 2025 16:06:15
Script start
Timing: Jan 18 2025 16:06:15
Module start 'layout'
Timing: Jan 18 2025 16:06:15
Module start 'content'
Timing: Jan 18 2025 16:06:17
Module end 'content'
Timing: Jan 18 2025 16:06:17
Script end

Main resources:

Total runtime1.1065 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 593.6484152.6250
Module start 'layout' 0.00690.0036 746.273439.4453
Module start 'content' 0.01051.0943 785.7188517.8438
Module end 'content' 1.10480.0016 1,303.562512.1641
Script end 1.1064  1,315.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2814160.0002
Check MTime0.00120.1109160.0001
Mysql Total
Database connection0.00160.141010.0016
Mysqli_queries1.042594.2159540.0193
Looping result0.00060.0502520.0000
Template Total1.063896.120.5319
Template load0.00210.190720.0011
Template processing1.061795.951520.5308
Template load and register function0.00010.011810.0001
states
state_id_array0.00200.179410.0020
state_identifier_array0.00270.244920.0014
Override
Cache load0.00180.1649590.0000
Sytem overhead
Fetch class attribute can translate value0.00100.094220.0005
Fetch class attribute name0.00130.117530.0004
XML
Image XML parsing0.00070.067720.0004
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00180.1617160.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs