eZ Community » Forums » General » Need multi-page article How-To
expandshrink

Need multi-page article How-To

Need multi-page article How-To

Friday 02 May 2003 6:06:38 pm - 10 replies

I cannot figure out how to get multi-page articles working, and I need your help.

I understand the concept of an "Article" class that is a container for multiple "Page" class objects, but what I'm having trouble with is implementing the multi-page functionality in template code. I have looked at the image gallery examples, but just can't figure it out yet.

Does anybody have any working code examples or any direction they could lend me? Any help appreciated!

Friday 02 May 2003 8:11:54 pm

Bill,
I hope I'm pointing to the right direction.

http://ezwiki.blanko.info/index.php/3XHT_MultiPage

Regards,

geo

Saturday 03 May 2003 7:06:08 pm

Yes and thank you. I've seen that page and it lays some groundwork, but doesn't give any concrete examples.

Has anybody implemented multi-page article functionality? Can anybody lend some working code/setup information?

Any help is greatly appreciated. We are trying to evaluate eZ Publish, and multi-page articles is one of the top feature we'd need to be able to implement.

Thanks again.

Monday 05 May 2003 4:39:28 pm

*bump*

Has anybody implemented multi-page articles in eZ3? If so, could you please share a how-to for those of us evaluating the product.

Thanks!

Monday 05 May 2003 5:01:34 pm

Here's quick and dirty example of a multipage article, consisting of two classes.

MultiPage Article (class id 6)
Attributes:
- Title (text field)
- Intro (xml field)
- Body (xml field)
MultiPage SubPage (class id 7)
Attributes:
- Title (text field)
- Body (xml field)

file: full_class_6.tpl
{* Full class template for Multipage Article *}

<h1>{$node.name}</h1>
<p>Last updated {$node.parent.object.published|l10n(datetime)}</p>

<div class="block">
{attribute_view_gui attribute=$node.object.data_map.intro}
</div>

<div class="block">
{attribute_view_gui attribute=$node.object.data_map.body}
</div>

{let children=fetch('content', 'list', hash(parent_node_id, $node.main_node_id, class_filter, include, class_filter_array(7)))
}

{* Subpages *}
<td width="140" valign="top" align="left">
 
<ul>
{section show=$children}
<h2>Sections</h2>
<li>{$node.name}</li>
{/section}
{section name=Child loop=$children}
<li><a href={$Child:item.url_alias|ezurl}>{$Child:item.name}</a></li>
{/section}
</ul>
</td>
{/let}

File: full_class_7.tpl
{* Full class template for Multipage SubPage*}

{let children=fetch('content', 'list', hash(parent_node_id, $node.parent_node_id, class_filter, include, class_filter_array(7)))
}

<div class="block">
{attribute_view_gui attribute=$node.object.data_map.title}
</div>
<p>Last updated {$node.parent.object.published|l10n(datetime)}</p>

<div class="block">
{attribute_view_gui attribute=$node.object.data_map.body}
</div>

{* Subpages *}
<td width="140" valign="top">
 
<ul>
<h2>Sections</h2>
<li><a href={$node.parent.url_alias|ezurl}>{$node.parent.name}</a></li>
{section name=Child loop=$children}
{section show=eq($Child:item.node_id, $node.node_id)}
<li>{$Child:item.name}</li>
{section-else}
<li><a href={$Child:item.url_alias|ezurl}>{$Child:item.name}</a></li>
{/section}

{/section}
</ul>
</td>

First you create a Multipage Article and then create Multipage SubPages under the article. The subpages should then be listen when you view either the main article or one of the subpages. (note: you might want to change the html around the listing of subpages)

Monday 05 May 2003 9:00:52 pm

I have added a How-To doc at http://ez.no/developer/ez_publish...o_several_pages_as_with_in_version_2
Check it out and comment.

Modified on Monday 05 May 2003 9:22:13 pm by James Ward

Tuesday 06 May 2003 5:19:11 pm

Thanks guys! That's exactly what I needed

Friday 09 May 2003 2:30:33 pm

In case anyone has had problems with the code posted by James Ward I have resolved it and ammended the dicumnetation. There is a missing {/let} command at the end of the block
{literal}
{switch match=count($page_list)}
{case match=not(0)}
{* Subpages *}
<table width="100%">
<td valign="top">
<h2>Pages</h2>
<a href={concat("/content/view/full/",$node.node_id,"/"blunk.gif Emoticon|ezurl}>Page 1</a> |
{section name=Page loop=$page_list}
<a href={concat("/content/view/full/",$Page:item.node_id,"/"blunk.gif Emoticon|ezurl}>{$Page:item.name|wash}</a> |
{/section}
</td>
</table>
{/case}
{/switch}
{/let}
{/literal}

It's geat code thought and I am using it.

Thanks James.

Fats.

Saturday 17 April 2004 2:13:21 pm

erm it's near to a yera ago since your last post, but does this code still wokr, that mutlipage howto you have done there, I cannot access it- is there away you could send it to me @ steve@dislexik.com please?

Regards

DislexiK

Wednesday 09 March 2005 9:55:41 pm

where is the howto? can someone point me to the right place?

Tuesday 29 March 2005 10:14:24 am

Certainly my fine sir:
http://ez.no/community/forum/setup_design/multi_page_article_again

Jonathan

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from