Forums / Setup & design / New class using article template

New class using article template

Author Message

James Peltier

Tuesday 23 September 2003 2:57:00 pm

I'm new to EZ Publisher. Actually, I'm very new I just downloaded it and installed it yesterday. Anyways, I'm using the corporate template for my base site design. I've renamed the Classes->Content->Article to be Notices since I don't want articles to appear in the news sections just Notices. I've then made a copy of the Notices Class in order to recreate it as Classes->Content->Articles now ID 14

The problem I'm having deals with getting the new Articles to look and act like the old articles. For some reason it will not use the article.tpl file. When I go to the page with the article it asks me to choose an article template. What am I doing wrong?

RW Wood

Tuesday 23 September 2003 6:41:46 pm

You're not doing anything wrong, just in the wrong order :) The first thing you need to do is spend several days reading the documentation from front to back. This is not another phpNuke clone, but a massive and powerful piece of software that you can't just download, install and take off with. I'm writing this as another user who has wrestled with getting to understand the program for several long weeks. The developers are very prone to help, but in all fairness to them, take some time to get a feel for what does what and how to sort out which templates turn out which display. (There's a way you can "turn on" a setting in the config files to show which templates are responsible for the display, and doing a search in the forums will find it for you) ;)

Don't consider this post a slap, but an encouragement to dig into the program to see what it's capable of.

HTH,
RWW

James Peltier

Tuesday 23 September 2003 11:13:21 pm

Thanks, and I don't consider this a slap at all. I've actually turned on debugging and was able to see that it was using standard full.tpl. I've been unable to get the full.tpl to be overriden by the article.tpl. I've added it to the override.ini as such

[article]
Source=node/view/full.tpl
MatchFile=article.tpl
Subdir=templates
Match[class]=14

[notice]
Source=node/view/full.tpl
MatchFile=article.tpl
Subdir=templates
Match[class]=2

however this hasn't seemed to help at all. I'm just not sure why this isn't working as according to the documentation this should have overridden the full.tpl template. I must be wrong in my understanding of how this works.

And I've looked at other CMS software packages such as Article Manager, Phorum, PHPNuke, etc and chose EZ Publisher because I like the "feel" of it, and it supported PostgreSQL :)

If someone could explain to me maybe more detailed this could help fill in the blanks. Not step by step per se but almost :) I'm sure I'm just missing one or two simple things.

Bjørn Kaarstein

Tuesday 23 September 2003 11:51:35 pm

You'll need to clear your cache in order to let the system find the changes in override.ini.

Also, I suggest you take a look at your anonymous user rights. When renaming article to notices, your anonymous user won't have the proper rights to read it.

I suggest that you create new classes instead of renaming the old, as the admin interface is controlled by several templates. This might cause a little fuzz...

Regards Bjørn

James Peltier

Wednesday 24 September 2003 8:13:14 am

I'm actually clearing the cache every time I make a change right now and it isn't helping. I was aware of the anonymous roles permission problem from a previous posting here so I have added the _new_ article and notice to the read permissions.

The anonymous user can see the article it just doesn't use the article template. I'm getting pretty frustrated now. I've looked throught the forums, documentation, google'd for help, looked through the wiki and I still can't get it to work :'?

Shurbann Martes

Wednesday 24 September 2003 9:19:08 am

check if debugging is teling you that it can or can't find the article.tpl.

If debug can't find it and you've uploaded it, you should check your override.ini. I don't know how you've organized your design directory but if the article.tpl is in /design/(your_design)/templates/node/view/article.tpl
you should change the line:
MatchFile=article.tpl
to
MatchFile=node/view/article.tpl

Good luck,
Shurbann

hannes petursson

Wednesday 24 September 2003 4:03:40 pm

I have this same problem. I have created new class and a template for this class but it always uses the standard full.tpl and this text comes above: "Default object view. Click to create a custom template" Pease help someone.

RW Wood

Wednesday 24 September 2003 6:39:20 pm

Check the following thread:
http://ez.no/developer/ez_publish_3/forum/setup_design/custom_template_again

Also: http://ez.no/developer/ez_publish_3/documentation/customization/custom_design/override_templates

You also need to make sure that you don't have a template override that points from the full.tpl that's in /templates to the one that's in /templates/node/view or vice versa. You should be able to tell from template debugging what template is actually being used.

I've found some problems with using clearcache from the admin interface, so what I do is a search in the /var/cache directory (or others if your site.ini.append puts cache files elsewhere) for all *.php files. Then I delete all those that are named with a long string of random letters and numbers. (be careful you don't delete the ones that actually have a name like expiry.php and common.php.)

In general when I can't find a problem any other way, I look in the source from the generated page for something that I can then search for in the files themselves, for example a class=somename that I can use with windoze search to search within files, in your case the whole design tree.

HTH,
RWW

hannes petursson

Thursday 25 September 2003 4:52:55 am

Thanks Wood
It seem like clearcache in the admin interface is not working. After I removed manually from /var/cache directory everything is working.