Forums / Setup & design / Questions about folder listing: pageinfo and default article

Questions about folder listing: pageinfo and default article

Author Message

Alexandre Cunha

Monday 18 August 2003 3:56:12 am

Hi,

Last weekend, using the examples provided by the default ezP3.1 instalation, i created a small site using the Content Classes: folders, articles and pageinfo. I setup bilingual content too with links to switch between the two languages (content and interface). Great !

I have 2 questions about folder listing.

1 - When a link to a folder, i can get the articles list. Each articles uses the template (i use the default template with some changes) line_article.tpl to show header and intro for that article. Using the same aproach, i created a line_infopage.tpl and created the entry:
[line_infopage]
Source=node/view/line.tpl
MatchFile=line_infopage.tpl
Subdir=templates
Match[class]=10
on the override.ini.append file (10 is the number of content class pageinfo)
Unfortunately i dont get the expected result and dont see the result of line_pageinfo.tpl. What im missing ?

2 - I want create a default content article or pageinfo each time i choose a list content folder. Instead of articles list, I want display the complete content of the most recent article (or pageinfo) published and then the articles list using the line_article.tpl.

Can someonte give ideas how to reach these results ??

Thank you,

axel

http://AlexandreCunha.com

Sander Jansen

Monday 18 August 2003 11:50:21 am

1: the attributes in the infopage class are not the same as in the article class. Info page doesn't have an intro attribute for example, which means nothing will show up when you duplicate the article override for infopage.

2: I wanted that too and finally found a solution. When a user attempts to browse a folder the latest article in it is shown instead. How I accomplished this? I made an override for node/view/full.tpl matching the folder class, inside the template there is a fetch function with limit 1 that shows the latest article (using node_view_gui view=full)
Under there you could print a list with the other articles using another fetch function. Read more about fetching here: http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/operators/data_fetch

Alexandre Cunha

Tuesday 19 August 2003 2:07:33 pm

Thank you Sander, your answer is very helpfull.

1 - Your answer for my question 2, lightened me about the solution for the question 1. The problem is not in the line_infopage.tpl but in the folder.tpl (this is a override full.tpl for the class 1 - folder listing). Edited folder.tpl and find:
class_filter_array, array( 1, 10 )
10 is the class id for infopage. I change to:
class_filter_array, array( 1, 11 )
and the problem is solved.

2 - Ok, you find the solution! I have the way to fetch limit 1. Trying to show the article using the article.tpl ...

thanks

axel

http://AlexandreCunha.com