Forum OpenACS Q&A: ETP content pages

Collapse
Posted by Richard Hamilton on
What is the best way to access a list of pages within a subtopic from the default-content.tcl script?

What I would like to do is put a 'next->' link at the bottom of each content page that links to the next one. If I call 'etp::get_content_items' from *-content.tcl I get back an empty array in content_items() of course, because this is the wrong context to call it and the content pages do not have any content items as children.

I need to be able to call 'etp::get_content_items' from *-content.tcl but in the context of *-index.tcl in order to obtain a list of all children of the current page's parent node (from which I can work out the 'next->' page link).

Thanks in advance.

Richard

Collapse
2: Re: ETP content pages (response to 1)
Posted by Harish Krishnan on
IMO as the "NEXT" link should be an attribute. So just extend the attribute list for the application type and deal with it in the respective ETP applicaton template which would be constructing a link of the attribute.
Collapse
3: Re: ETP content pages (response to 1)
Posted by Richard Hamilton on
Thanks for the reply. That had crossed my mind as the more straightforward way to do it (and I agree with the logic that 'next' can be viewed as an attribute of a page) but I was thinking that automating the next link would avoid the need for more user editing. The links would follow the sequence number set by manually ordering the content items in the etp application (also stored as an attribute of the content item).

Having said that, perhaps I am looking for a time consuming, difficult option when what you suggest would do the job perfectly well.

Regards
Richard