Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Multidoc: multiple-page documents
Thanks to net-carver/Steve for his elegant suggestion, I have scrapped the soo_multidoc_article and soo_multidoc_article_custom tags; normal article and article_custom tags now give the desired behavior for Multidoc articles in article lists. There are also a few minor changes to soo_multidoc_pager.
Code is topiary
Offline
#17 2009-06-03 03:51:14
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: Multidoc: multiple-page documents
Jeff
so that wild idea actually worked? Nice.
— Steve
Offline
Re: Multidoc: multiple-page documents
Works a treat and only needed about 10 lines for the callback function itself. Seems to have improved speed on article lists, even witout caching or pre-computed tables as you had suggested. Thanks again.
Code is topiary
Offline
Re: Multidoc: multiple-page documents
Promoted from alpha to beta: now at version 1.0.b.1
Important This is a major upgrade, because the underlying library has been overhauled. Use care when upgrading an existing Multidoc site; I don’t expect issues but YMMV. If you run soo_image you will need to upgrade it at the same time.
No significant new features per se, other than a downshift to v2.0 of the GPL to match the Txp license.
Full user guide, including download & installation instructions
Code is topiary
Offline
#20 2009-07-09 13:45:17
- woof
- Member

- Registered: 2004-08-01
- Posts: 128
Re: Multidoc: multiple-page documents
Hi J Soo
Finally getting to grips with this plugin and finding its great for organising articles.
I’m trying to figure out if I could incorporate the toc list into my site’s main nav – Is it possible to output a nested list of Multidocs in txp:article_custom’s output?
e.g. I want to dynamically* output something like this as my site’s main nav (where Article2 in SECTION_1 below is a Multidoc )
<ul id="nav">
<li><a href="#url">HOME</a></li>
<li><a href="#url">SECTION_1</a>
<ul>
<li><a href="#url">Article1</a></li>
<li><a href="#url">Article2</a>
<!-- begin Multidoc output -->
<ul>
<li><a href="#url">MultidocArticle_a</a></li>
<li><a href="#url">MultidocArticle_b </a></li>
</ul>
<!-- end Multidoc output -->
</li>
<li><a href="#url">Article3</a></li>
<li><a href="#url">Article4</a></li>
</ul>
</li>
<li><a href="#url">SECTION_2</a>
<ul>
<li><a href="#url">Article5</a></li>
<li><a href="#url">Article6</a></li>
<li><a href="#url">Article7</a></li>
<li><a href="#url">Article8</a></li>
</ul>
</li>
</ul>
(*dynamic article output only, sections are hard-coded)
I thought using soo_multidoc_toc in the article_custom’s form as follows might achieve it but it doesnt seem to work inside article tags
<txp:if_first_article><ul></txp:if_first_article>
<li>
<txp:permlink><txp:title /></txp:permlink><txp:soo_multidoc_toc />
</li>
<txp:if_last_article></ul></txp:if_last_article>
Am I pushing it in the wrong direction… or missing something obvious?
thanks woof
Offline
Re: Multidoc: multiple-page documents
Currently the output tags only produce output in individual article context. The general initialization routine is pretty complicated, just dealing with a single collection. I didn’t want to get into potentially initializing multiple collections because of the added complexity and also the performance hit — there is already a noticeable performance cost to using Multidoc.
However, it might be reasonable to offer a limited set of navigation links for Start articles only, just listing top-level content. So for a hierarchical collection such as the Multidoc user guide, this listing would just show top-level sections. I’ll give it some thought. Do you think that would fit your needs?
Code is topiary
Offline
#22 2009-07-09 16:23:12
- woof
- Member

- Registered: 2004-08-01
- Posts: 128
Re: Multidoc: multiple-page documents
Thanks J Soo. To answer your question — In my specific case I’d be happy showing just 1 level under the 1st Multidoc page. But I don’t want to overcomplicate things for you or the plugin which is really amazing as it is. For my immediate needs I’ll just readjust my ambition and use soo_multidoc_toc to output contents in a separate list — similar to how it is in your Multidoc user guide.
BTW What spurred my attempt at nesting the Multidoc toc inside the main site navigation unordered list was so I could then fully use this neat way to create a sitemap from HTML unordered list navigation: http://astuteo.com/slickmap/
Offline
Re: Multidoc: multiple-page documents
woof wrote:
What spurred my attempt at nesting the Multidoc toc inside the main site navigation unordered list was so I could then fully use this neat way to create a sitemap from HTML unordered list navigation: http://astuteo.com/slickmap/
That is indeed some slick CSS work. Thinking more about your idea, even the limited output I suggested is going to be more difficult than I first thought (I’ve been typing that last phrase a lot lately, it seems). Especially if this nav is to be reproduced on every page: Multidoc treats individual article pages very differently from list pages. My method of getting article lists to suppress Multidoc interior pages is to create a temporary textpattern table that excludes them. In other words, as far as that article list is concerned, the suppressed pages don’t exist. Difficult to link to them, then :)
I have been thinking, rather vaguely, about creating some kind of Multidoc backend admin tab: allow one to view collections various ways, and assign or re-arrange pages without having to edit the custom field. Conceivably along with this there could be a cache holding at least some information about all collections, and this cache might be used to produce the kind of navigation element you have envisioned. The cache would be updated on the admin side, either automatically after an edit, or manually, so it wouldn’t slow viewer page loads. Just brainstorming at this point.
Code is topiary
Offline
Re: Multidoc: multiple-page documents
Version 1.0.b.2 just released.
- New tags:
soo_multidoc_page_title(drop-in replacement forpage_title)soo_multidoc_breadcrumbsbreadcrumb trail within Collections
- changed to new soo_plugin_pref plugin for preference management
Code is topiary
Offline
#25 2010-01-27 21:39:04
- woof
- Member

- Registered: 2004-08-01
- Posts: 128
Re: Multidoc: multiple-page documents
Hi Jeff, I’m back giving this plugin another workout
One thing I’ve noticed with <txp:soo_multidoc_toc /> is that it seems to include pages regardless of their article status, so should an editor change a multidoc article’s status (e.g. to hidden or draft) its title/link will still show in the toc even though the page is now inaccessible.
Is there any way around this? — ie to output only pages whose status is live?
Last edited by woof (2010-01-27 21:39:50)
Offline
Re: Multidoc: multiple-page documents
Very good point I hadn’t thought of. Thinking cap on …
Code is topiary
Offline
Re: Multidoc: multiple-page documents
Version 1.0.b.3 now available
(requires updated version of soo_txp_obj, available on the download page)
- Articles without
liveorstickystatus now excluded - Expired articles now excluded or not, according to site preference
- New preference for showing past, future, or all articles
Thanks to woof for the suggestion.
Note:
Though a small change in terms of edited code, it does alter the initialization routine at the heart of Multidoc. It has been tested, but not extensively tested.
Last edited by jsoo (2010-01-28 12:04:59)
Code is topiary
Offline
Re: Multidoc: multiple-page documents
Hi,
I’ve been fiddeling with the plugin and getting nowhere really really fast. It’s probably me being dim but i when i use it pages disappear.
Would it be possible to see a whole txp section-page, with individual_article and couple of necessary forms, so i can see the context within which you use your fancy multdoc tags?
I think, therefore I AM, … … er … I think :-?
Offline
Re: Multidoc: multiple-page documents
You’re not dim :) It’s not the world’s most intuitive plugin. If you are getting unexpected results, check to see if Multidoc is providing any useful error messages.
The only site on which I currently use it is my personal site. Page template is nothing out of the ordinary, just a normal article tag.
Relevant bits of my default article form:
<txp:if_article_list>
<!-- standard Txp tags for article list formatting -->
<txp:else />
<txp:soo_if_multidoc><txp:output_form form="soo_multidoc_header" /></txp:soo_if_multidoc>
<!-- standard Txp tags for individual article formatting -->
<txp:soo_if_multidoc><txp:output_form form="soo_multidoc" /></txp:soo_if_multidoc>
</txp:if_article_list>
The soo_multidoc_header form looks like this:
<p id="soo_multidoc_header"><txp:soo_multidoc_link rel="start" add_title="1" /> <txp:soo_multidoc_page_number /> <span id="arrows"><txp:soo_multidoc_link rel="prev">«</txp:soo_multidoc_link> <txp:soo_multidoc_link rel="next">»</txp:soo_multidoc_link></span></p>
It makes a header that looks like this:
The soo_multidoc form looks like this:
<ul id="soo_multidoc_prev_next"><txp:soo_multidoc_link rel="Start" add_title="1" wraptag="li" /><txp:soo_multidoc_link rel="Contents" wraptag="li" /><txp:soo_multidoc_link rel="Up" wraptag="li" /><txp:soo_multidoc_link rel="Prev" wraptag="li" /><txp:soo_multidoc_link rel="Next" wraptag="li" /><txp:soo_multidoc_link rel="Download" wraptag="li" /><txp:soo_multidoc_link rel="Help" wraptag="li">Support</txp:soo_multidoc_link><txp:soo_multidoc_link rel="Copyright" wraptag="li">License</txp:soo_multidoc_link>
</ul>
It makes a footer that looks like this (all links, actual anchor tags omitted for this example):
Multidoc | Contents | Up | Prev | Next | Download | Support | License
So that header and footer appear automatically for any individual article view of a Multidoc article.
Perhaps the tricky part is correctly managing the Multidoc custom field. Here’s the value for the start page of my Multidoc user manual:
Contents 33,Section 31 34 30,Help 43,Copyright 29
because article #33 is the table of contents, articles 31, 34, and 30 are “chapter” header pages, and so on.
It’s also possible to use Multidoc tags directly in article bodies, as I do at various point throughout the support article.
Code is topiary
Offline
Re: Multidoc: multiple-page documents
Thx very much. I’ll take a good look and test everything when i get a mo this week. BTW I was getting no multidoc error messages
I think, therefore I AM, … … er … I think :-?
Offline