Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-04 22:14:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Multidoc: multiple-page documents

CAVEAT USER

Please read the readme page before installing.

Multidoc

A system for assembling, managing, and creating navigation elements for multi-page articles. You can have Textpattern treat a Multidoc collection as a single unit (optional), while you get the benefit of dividing long articles into parts.

Features

  • automatically-generated navigation links, pagers, and tables of contents
  • easy collection management, with unlimited levels of structure (chapters, sub-sections, what have you)
  • filter sub-pages out of your front page article lists (if you want to), while keeping them available for search results
  • MLP-ready (I think; untested)

Requirements

  • PHP 5

Full details here: Multidoc

Last edited by jsoo (2010-09-14 13:34:18)


Code is topiary

Offline

#2 2009-02-04 22:52:33

woof
Member
Registered: 2004-08-01
Posts: 128

Re: Multidoc: multiple-page documents

wow, this sounds and looks fantastic, thanks!

The timing is great for a project I’m working on that I reckon could use this – I’ll certainly give it a spin and report back

Offline

#3 2009-02-06 10:25:57

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Multidoc: multiple-page documents

I read your documents on site and I’m amazed.

I’d like to try your plugin for a site of mine, but unfortunately on that server I can’t use PHP 5. There is a reason why the plugin can’t be PHP4 compatible?

Bye

Z-

Offline

#4 2009-02-06 16:25:30

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Multidoc: multiple-page documents

Zanza wrote:

There is a reason why the plugin can’t be PHP4 compatible?

There’s no reason I couldn’t have written it for PHP4 — to be honest I didn’t give it much thought when I started. Given that Txp doesn’t require 5, I probably should have done it in 4. I’ll have a look at how much I’d need to do to downgrade it.

Addendum

I no longer have any working PHP 4 setups, making it impossible for me to make a meaningful attempt to downgrade the plugin — sorry.

Last edited by jsoo (2009-02-07 22:16:13)


Code is topiary

Offline

#5 2009-04-02 19:33:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Multidoc: multiple-page documents

Just uploaded version 1.0.a.4, which adds limit and placeholder attributes to the <txp:soo_multidoc_pager /> tag. This allows you to use placeholders to keep the paging widget from getting too long. Example:

<txp:soo_multidoc_pager limit="1" />

gives something like when you are on page 5:

[1] … [4] [5] [6] … [12]

That is, limit="1" shows only one page before and after the current page (the first and last pages are always shown).


Code is topiary

Offline

#6 2009-05-03 00:58:55

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Multidoc: multiple-page documents

Now on version 1.0.a.5:

Added <txp:soo_multidoc_page_number />. This allows output such as “Page 2 of 12”.

Fixed a bug regarding multiple soo_multidoc_pager tags on the same page.

Added compatability with soo_plugin_prefs plugin.


Code is topiary

Offline

#7 2009-05-06 14:01:20

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Multidoc: multiple-page documents

jsoo:

Your plug in sounds very interesting and thanks for the effort. I have read the documenttation that you provided (which is well written) but I still have a question.

As an example, if I have a single article and for arguments sake lets say it has 16 paragraphs, how could I use your plug in so that every 4th paragraph it page breaks ….

I see where you talk about the the Custom Field, but does that eman I have to enter my above example as 4 seperate articles and assign these articles to their own section?

Thanks.

progre55

Offline

#8 2009-05-06 20:21:21

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Multidoc: multiple-page documents

progre55 wrote:

As an example, if I have a single article and for arguments sake lets say it has 16 paragraphs, how could I use your plug in so that every 4th paragraph it page breaks ….

I see where you talk about the the Custom Field, but does that eman I have to enter my above example as 4 seperate articles and assign these articles to their own section?

That is indeed how this plugin works. If you prefer to have a single Txp article with page breaks you might want to look into this. I’ve not used it, but it sounds more like what you want.

Where Multidoc comes into its own is when you want not just page breaks, but structure such as chapters. Or when you want automatic navigation through the article. Or when you have an article that is very long indeed. (All of which apply to the Multidoc documentation.)


Code is topiary

Offline

#9 2009-05-07 12:19:46

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Multidoc: multiple-page documents

jsoo:

Thanks for the feedback and direction.

progre55

Offline

#10 2009-05-23 18:02:37

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Multidoc: multiple-page documents

Jeff

trying this out as a candidate for mini step-by-step abouts and tutorials for a new site. Think I’ve found a limitation that may need a little TLC, especially if folks are using glz_custom fields…

Problem: Invalid SQL warning in soo_multidoc_article and soo_multidoc_article_custom.

Example:

<txp:soo_multidoc_article section="about" /> ->  Textpattern Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and Section IN ('about')' at line 1
select count(*) from textpattern where 1=1 and Status >= 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and ID NOT IN() and Section IN ('about')

NB: and ID NOT IN() seems to be the culprit here.

Steps to reproduce problem

  • Go to admin > prefs > advanced
  • Setup ‘Multidoc’ in the 10th custom field
  • Save the change
  • Visit the root article of your multidoc article collection and setup the newly created Multidoc custom field as needed
  • View section with the article/article_custom replacement… boom!

My Workaround

Not too sure yet as this is my first look at the code (nice by the way!) I see this line in _soo_multidoc_custom_field()

if ( preg_match('/^(custom_\d)/i', $key, $match) )

which seems to be matching only cfs 1..9 and missing the double digit match needed for the 10th field (and beyond if using Gerhard’s plugin.) Replacing with…

if ( preg_match('/^(custom_\d+)/i', $key, $match) )

…seems to have restored things.


Steve

Offline

#11 2009-05-23 18:29:34

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Multidoc: multiple-page documents

Jeff

BTW, the download page, whilst referring to version 1.0.a.5 seems to be delivering v1.0.a.4 to me. Is a.5 publicly available yet?

Many thanks in advance!


Steve

Offline

#12 2009-05-23 18:50:59

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Multidoc: multiple-page documents

Steve: I believe you’re right about ID NOT IN() being the problem. I will do a bit more testing, but it seems the fix is to replace

if ( _soo_multidoc_ids_init() and ! $q )

with

if ( _soo_multidoc_ids_init() and ! $q and $soo_multidoc['noindex'] )

in _soo_multidoc_doArticles(). (You can quickly find the above line by searching for:

// soo_multidoc hack

I’ll roll this into a new release ASAP, but include the above in case you want to carry on with it now.

I presume you saw this error when you had not yet assigned any articles to Multidoc? Or not … next time I’ll actually read the whole post first.

Thanks very much for the note.

Last edited by jsoo (2009-05-23 18:58:41)


Code is topiary

Offline

Board footer

Powered by FluxBB