Need multi-page article How-To

Author Message

Bill Miller

Friday 02 May 2003 9:06:38 am

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!

geovanni rosetto

Friday 02 May 2003 11:11:54 am

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

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

Regards,

geo

Bill Miller

Saturday 03 May 2003 10:06:08 am

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.

Bill Miller

Monday 05 May 2003 7:39:28 am

*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!

Ole Morten Halvorsen

Monday 05 May 2003 8:01:34 am

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)

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

James Ward

Monday 05 May 2003 12:00:52 pm

I have added a How-To doc at http://ez.no/developer/ez_publish_3/documentation/ez_publish_3/howtos/how_do_i_split_an_article_into_several_pages_as_with_in_version_2
Check it out and comment.

working at www.wardnet.com
blogging at www.jamesward.ca

Bill Miller

Tuesday 06 May 2003 8:19:11 am

Thanks guys! That's exactly what I needed

Stuart Fenton

Friday 09 May 2003 5:30:33 am

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,"/")|ezurl}>Page 1</a> |
{section name=Page loop=$page_list}
<a href={concat("/content/view/full/",$Page:item.node_id,"/")|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.

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Steve Clarke

Saturday 17 April 2004 5:13:21 am

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

rombeh rorombeheun

Wednesday 09 March 2005 12:55:41 pm

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

Jonathan Dillon-Hayes

Tuesday 29 March 2005 12:14:24 am

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

Jonathan

---------
FireBright provides advanced eZ deployment with root access
http://www.FireBright.com/

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