Directory structure explained?

Author Message

Lance Leger

Thursday 01 May 2003 2:53:14 am

I'm having problems viewing custom templates that I create. Is there any
special rules you have to follow when creating a custom template? I've
tried creating a template called frontpage.tpl and setting it in the
/design/user/override/templates/content/view folder and nothing
happens when I try to load this page manually. I've started to experiment
with working templates to see if I can understand why none of the
templates I create are visible and it doesn't appear to be a roles issue.

For example, should I be able to create a file called testing.tpl with
only the word "test" inside and then put this file in the
/design/user/override/templates/content/view folder then be able
to go to http://mysite.com/index.php/user/content/view/testing
and see the word test displayed?

Any help would be greatly appreciated.

Vivienne van Velzen

Thursday 01 May 2003 4:45:26 am

Lance,

This is my view on template-usage in EZP (please feel free to correct me if I'm wrong).
It all works with IDs. For instance, to view a content-item, you'll get a url like:
http://mysite.com/index.php/user/content/view/full/11.
With this url you indicate that you want to view (obviously) the content-item with node-id 11 with the 'full' template (defined in /design/standard/templates/node/view/).

If you want to use a custom 'full' template, you have to go to /design/yoursite/override/templates/node/view, and create one.
This could be a full_node_11.tpl (used whenever a 'full' view of the content-item with node-id 11 is asked for). Or, if you want something more generic, you could redefine the 'full' template of a class, i.e. full_class_xx.tpl (in which xx is the id of the class of the content-items that you want to view in this way).

Now, you can also design your own views, which you put in /design/yoursite/templates/node/view. If you want to use these templates you have to access them from the page in which you want them to be shown, like:
{node_view_gui view=myownview content_node=$node}
where myownview.tpl is in the directory /design/yoursite/templates/node/view.

I'm not really sure myself yet about the difference between viewing content or nodes (except the fact that you use content_view_gui (and the /content/view directory) in the first case and node_view_gui (and the /node/view directory) in the second).

Hope this helps.

Vivienne

Karsten Jennissen

Thursday 01 May 2003 5:08:52 am

Hi,

are you aware of this doc?
http://ez.no/developer/ez_publish_3/documentation/ez_publish_3/terminology_basics/custom_designs_directory_structure_explained

As you are trying to create your own view mode, take a look at this:
http://ez.no/developer/ez_publish_3/documentation/ez_publish_3/terminology_basics/view_modes_of_objects

Also be sure to turn off cache / clear cache while you develop.

Karsten

Vivienne van Velzen

Thursday 01 May 2003 5:20:43 am

OK, the documents Karsten mentioned probably explain it a bit better ;).

Karsten, just one question. If you make a completely new (generic) template, would you put this one also in the override/ directory (as implied in http://ez.no/developer/ez_publish_3/documentation/ez_publish_3/howtos/how_do_i_create_my_own_content_view_mode)?
I'd think that one goes in the /design/yoursite/templates/node/view directory. I know, I know, it's probably a decision everyone has to make for themselves, but I'm a sucker for standards.
Greetz,

Vivienne

Karsten Jennissen

Thursday 01 May 2003 7:03:33 am

Hi Vivienne,

actually, I am not completely sure about the logic of the structure, as you can find generic templates in the demo site in the override folders. But you are right. :-)

Karsten

Lance Leger

Thursday 01 May 2003 5:19:50 pm

What if my template is not displaying data for a specific node? For example,
my template will be dislaying articles that are not related to each other.
The articles do not reside in the same locations. It seems like you should be
able just to display a template with the contents "test" without referencing
a particular node or ID.

Vivienne van Velzen

Friday 02 May 2003 2:32:23 am

Well, you've got me stumped on this one.
The only solution that I can see at the moment is to create a folder (i.e. 'newarticles') and add this location to the non-related articles (see the edit-screen of the articles for this). You can then use your template as default template for the 'newarticles' folder, since you now have a node-id.
This may not be what you want, but it's all I can think of now.
Greetz,

Vivienne

Marco Stipek

Thursday 15 January 2004 6:24:38 am

Links wrong! "module not found error"

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