Configuring sections and applying templates to sections

Author Message

chris mattmann

Wednesday 27 August 2003 3:50:13 pm

Hello,

I am a developer trying to deploy EZPublish to my company's website. I have created 2 virtual sites, we'll call them 'site1', and 'site1.admin', and set up URI based access to these sites, so to access these sites, I go to the following URL(s):

http://localhost/index.php/site1
http://localhost/index.php/site1.admin

Okay, so with the creation of those 2 new sites, I have added design templates in

<ez publish root>/design/site1
<ez publish root>/design/site1.admin

Okay, with that said, I have been able to configure the 'pagelayout.tpl' file for the site1 website to display the string "Hello world", and that's it, to test that it is using the correct template, and I have got this part to work.

The problem that I am having now is where to go next. I would like to begin creating sections, but I have a few questions as I am having trouble creating sections.

Question #1: By default, EZPublish comes with a 'demo, standard, admin, and user' site. The admin site allows you to add sections, content objects, etc etc. My question is--are the sections and content objects and such that I add in the 'regular admin' section that comes with the default installation, useable in my 'site1' website that I created? That is, do I need to create the content objects using a special admin interface that is only available to the 'site1' site? I have had trouble with this, as I tried creating a book content class via the default admin interface, and it came back with a class ID of 14. Then when I tried to view that class object in my 'site1' site, I was not able to view it.

Question #2: Okay, how do I even create sections? I mean, if I create them through the admin interface (and let's assume that once I create a section through the default admin interface that the section object ID is available to all the other "virtual sites" like my 'site1'), how do I assign templates to that particular section such that whenever I access that section, a different template comes up? Moreover, how do I even access that newly created section? I sort of understand that design templates can go in the "<ez publish root>/design/<your site>/override/templates/node/<line or full>/" directories, but what do I do then? How do I:

1) Assign templates to my newly created section
2) Access my newly created section

Any help that someone could give on this issue would be MUCH appreciated, as I have not been able to figure this out by reading the documentation at all.

Thanks in advance,
Chris A. Mattmann
Associate Software Engineer, Earth Science Data Systems
Jet Propulsion Laboratory
chris.mattmann@jpl.nasa.gov

Willie Seabrook

Wednesday 27 August 2003 7:35:27 pm

Answer #1:

No, all data created through the admin interface is available everywhere. There are two possible reasons why you cannot view any objects of your book class on the site1.

1. Your template is configured incorrectly (are you using fetch correctly, with 'node' function?) Templates are hard to debug but turn debugging on in site.ini. Look at the templates for the class that come with ez.

2. (And this problem has effected me) is that perhaps your viewing as the anonymous user. ezpublish will not tell you by default that access has been denied - it will just not show anything (another annoying thing). Try going to /user/login and entering admin details and then go back and attempt to view your object.

Answer #2:
Find override.ini.append for your new site (this is where templates are assigned) and add something like the following:

#Books
[books]
Source=node/view/full.tpl
MatchFile=my_book_template.tpl
Subdir=templates
Match[class]=14
Match[section]=88

Where 14 is the class id and 88 is the section id. This is telling ez that "if you are showing something in section number 88 and it is of type 14 then use the template my_book_template.tpl that is found in /override/templates."

A section is not really a seperate place on your website its just an "id" that is assigned to a subtree of folders in the site. You do this by first creating a new section and then clicking on the "assign" button, then selecting the top level folder that you want to assign it to.

Yes the documentation sucks, and despite what the ezpublish guys say the community is very small and inactive. Its getting better though. Ezpublish 3 is not as ez as it appears. It does kick serious butt though once you get a hang on it. Check out the wiki I can't remember the url but the google search "ezpublish wiki" finds it.

Regards,
Willie

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