Forums / General / Need multi-page article How-To

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/

eZ debug

Timing: Jan 18 2025 11:08:27
Script start
Timing: Jan 18 2025 11:08:27
Module start 'content'
Timing: Jan 18 2025 11:08:28
Module end 'content'
Timing: Jan 18 2025 11:08:28
Script end

Main resources:

Total runtime0.8296 sec
Peak memory usage4,096.0000 KB
Database Queries230

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 587.7031180.8438
Module start 'content' 0.00820.6965 768.5469858.8594
Module end 'content' 0.70470.1247 1,627.4063349.3203
Script end 0.8294  1,976.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4895210.0002
Check MTime0.00160.1893210.0001
Mysql Total
Database connection0.00120.143510.0012
Mysqli_queries0.723487.20452300.0031
Looping result0.00240.28542280.0000
Template Total0.797496.120.3987
Template load0.00170.207720.0009
Template processing0.795795.919020.3979
Template load and register function0.00010.016510.0001
states
state_id_array0.00140.166810.0014
state_identifier_array0.00180.222020.0009
Override
Cache load0.00170.20991240.0000
Sytem overhead
Fetch class attribute can translate value0.00170.199290.0002
Fetch class attribute name0.00150.1805130.0001
XML
Image XML parsing0.00220.262490.0002
class_abstraction
Instantiating content class attribute0.00000.0026130.0000
General
dbfile0.00660.7944330.0002
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
24content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
17content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 56
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs