Forums / Developer / Questions from a newbie (?)

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 )