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.

eZ debug

Timing: Jan 30 2025 19:34:13
Script start
Timing: Jan 30 2025 19:34:13
Module start 'layout'
Timing: Jan 30 2025 19:34:13
Module start 'content'
Timing: Jan 30 2025 19:34:13
Module end 'content'
Timing: Jan 30 2025 19:34:13
Script end

Main resources:

Total runtime0.0280 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.1250151.2109
Module start 'layout' 0.00660.0041 739.3359220.6875
Module start 'content' 0.01080.0155 960.02341,009.7578
Module end 'content' 0.02620.0017 1,969.781345.9922
Script end 0.0279  2,015.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002810.0953140.0002
Check MTime0.00113.8616140.0001
Mysql Total
Database connection0.00124.457810.0012
Mysqli_queries0.002910.345730.0010
Looping result0.00000.138810.0000
Template Total0.00124.210.0012
Template load0.00093.118110.0009
Template processing0.00031.028910.0003
Override
Cache load0.00051.872110.0005
General
dbfile0.00165.630680.0002
String conversion0.00000.060540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs