Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#91 2006-08-05 03:30:51

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Is it possible to assign titles to pages and have those show up as the prev/next links?

Also, a small request:

if_first and if_last conditionals would be a most welcome addition for more dynamic navigation.

Cheers

Offline

#92 2006-08-05 12:40:27

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

I just installed it and its pretty darn awesome. I just wish I could output page titles instead of numbers :(

THe cool part is I see you have added those conditionals .. nice!

The only thing keeping me from using this is the page title issue.. I just may take your plugin apart some and see if I can hack up a solution myself.

Last edited by Ace of Dubs (2006-08-05 12:49:46)

Offline

#93 2006-08-06 01:03:53

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

arkham wrote:

Having just re-read the 1st page of this thread I realize that some people wanted the page-specific text not just as a teaser to click to the next page but as an overall navigation option (a list of all page titles). The nav function can be easily modified to handle that by making use of the same code from etz_pg_body: preg_match_all($pageSep, $thisarticle[‘body’], $matches); $matches [ 1 ]0 would now have the 1st page title. $matches [ 1 ]1 the second and so on… In this case you’d need to add another option to the tag etz_pg to control whether this type of page title navigation should be used

Been trying to hack this up for hours. If anyone can figure out how to do this, I’d be willing to contribute some funds for the cause

Offline

#94 2006-08-06 15:16:48

Freshmango
New Member
From: Braunschweig, Germany
Registered: 2004-06-14
Posts: 7
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Titles instead of numbers would be great. If anyone comes up with a solution I am very interested in it.


<a href=“http://dennisfrank.info” title=“Dennis Frank gestaltet – Portfolio” style=“display: block; background:#efefef; color: #545454; float: left; padding: .5em; border: 1px none #9f9f9f; text-decoration: none;”><span style=“border-bottom: 1px solid #9f9f9f;”>Dennis Frank portfolio</span></a>

Offline

#95 2006-08-06 18:20:21

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

I have made some progress on this.

Here is the relevant code the author uses to output his fancy title listing, which je calls “teaser”:

bc..
preg_match_all($pageSep, $thisarticle[‘body’], $matches);

$teaser = $matches1[$pg-1];

This is what actually displays the title of the next page:

bc..
if (!empty($teaser)) return $pagecontent.’<p id=“teaserTxt”><a href=”’.$linkstub.($pg + 1).’”>’.$teaser.’</a></p>’; else return $pagecontent;

So I decided to define a new attribute with the others, and make it true instead of false, so that it is off by default and an entry of “1” will turn it on:

bc..
$titles = isset($titles) ? $titles : true;

Then I lift the code from the numerical list and call it titles as well

bc..
if (!($titles)) { for ($i = 1; $i <= $max; $i++) { $out[] = ‘<li class=“pgNum’;

if ($i $max) { $out[] = ' pgLast'; } if ($pg != $i) { if ($i 1) { $out[] = ‘”><a href=”’.$base_url.’”>’; } else {$out[] = ‘”><a href=”’.$linkstub.($i).’”>’; } } else { $out[] = ‘ pgCurrent”>’; }

$out[] = $i; if ($pg != $i) $out[] = ‘</a>’; $out[] = ‘ ‘; $out[] = ‘</li>’; }
}

I test it and see that its still outputting numbers, of course I haven’t set up my teaser yet.. so I track down the number output from above as follows:

bc..
$out[] = $i;

Awesome.. I have pinpointed my target, but I still have not figured out how to create the relationship between my attribute and the rest of the article titles.

I tried modding the above snippet:

bc..
$out[] = $teaser;

But that fails and I think my problem lies where I first started:

bc..
preg_match_all($pageSep, $thisarticle[‘body’], $matches);

$teaser = $matches1[$pg-1];

I realize that I need to create a new variable instead of teaser. I just don’t understand how to link this properly to $matches in order to spit out the page titles instead of their numbers.

Any ideas?

Offline

#96 2006-08-07 18:18:42

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Hello everyone. There’s version 0.8 of the plugin available offering at last the much requested feature: Subsection titles. In order to make use of this feature you have to:

  1. Download the latest version of the plugin, install it via the admin interface, and enable it. This requires full admin privileges.
  2. Name a custom field “etz_pg_subs”; case matters. You do this via the “Advanced preverences” in your admin interface.
  3. Go to a paginated article that’s been split in numbered sections, and click on “Advanced options”.
  4. In the “etz_pg_subs” custom field, for an article with, let’s say, 4 sections, write: “This is section one|This is section two|This is section tree|And last but not least, section four”. The names of the sections are separated with vertical bars. Note that the number of the vertical bars must be equal to the number of [page] separators in the body of the article.

A personal anouncement: I have a new job, and it’s very time-demanding. This will cause me to respond with some delay to bug reports and user requests. If you however appreciate what I’ve done so far, show it by buying me something from my Amazon wishlist.

Last edited by Etz Haim (2006-08-09 16:00:47)

Offline

#97 2006-08-07 18:20:28

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Hooray for Etz! :D

BTW, the link to your wishlist is broken, dude

Offline

#98 2006-08-07 18:43:46

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Wishlist fixed, too.

Offline

#99 2006-08-07 20:25:32

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,255
Website GitHub

Re: [plugin] [ORPHAN] etz_pg for paginated articles

way to go, etz. I guess you’ve been reading the other thread ;-)

Congrats on the new job too!


TXP Builders – finely-crafted code, design and txp

Offline

#100 2006-08-08 10:00:53

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

bq..
Fatal error: Call to undefined function assert_article() in /usr/home/housecaf/public_html/123txp/textpattern/lib/txplib_misc.php(459) : eval()’d code on line 261

:(

Also I miss Arkham’s Teaser link for the next page. Would that be possible with your custom field solution?

Last edited by Ace of Dubs (2006-08-08 10:02:35)

Offline

#101 2006-08-08 16:33:04

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Well, it seems my PHP skills are finally starting to take flight (they better after so many hours pulling my hair out!)

For those of you interested in having the titled menu along with the Teaser link for the next page, look no further:

Edit: Newer version with teaser and attributes

All you gotta do is edit your Etz Plugin, paste my hack in and you’re good to go.

Happy Paginating! :D

Last edited by Ace of Dubs (2006-08-09 17:10:25)

Offline

#102 2006-08-08 17:52:09

p_see
Member
Registered: 2006-02-24
Posts: 17

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Hi everybody
I think I have found a little point_bug in etz_pg (version 0.8)
Look at this line and see the <code>.</code> before the <code>=</code>
<code>$etz_pg[‘linkstub’] .= (etz_pg_permlinkmode() == 1) ? ‘?pg=’ : ‘&amp;pg=’;</code>

It breaks the url (at least in messy url, I don’t know with clean url).

This plugin is… very useful. Thanks

Offline

#103 2006-08-09 16:07:31

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

OK everyone. There’s version 0.8.1 out, which fixes the bug Ace of Dubs reported. Upgrade recommended.

p_see, this point is meant to be there. I’d be interested however to know in which way you think that it “breaks the url”, so please return with more specific information.

As for the “teaser”, be patient! I am currently testing the 0.9 version, which includes a custom navigation control that can be manipulated to output a “teaser”. Most importantly, this is done with a use of a new tag, not a hack in the source.

Offline

#104 2006-08-09 16:16:46

Ace of Dubs
Member
Registered: 2006-04-17
Posts: 446

Re: [plugin] [ORPHAN] etz_pg for paginated articles

Hey Etz,

I went ahead and built a new teaser function already

<code><txp:etz_pg_teaser /></code>

Which accepts the following attribute

<code><txp:etz_pg_teaser label=“Next Chapter:”/></code>

In the above example your teaser link will read “Next Chapter: Page Title”

Also, I polished my original hack with separate function for cleanliness and conditional code so that teaser does not show on the last page.

Tested, debugged and kicking ass on my vanilla install of TXP :)

Here is the Code

Last edited by Ace of Dubs (2006-08-09 16:17:36)

Offline

#105 2006-08-09 18:45:41

Etz Haim
Archived Plugin Author
From: Karlstad, Sweden
Registered: 2005-01-24
Posts: 262
Website

Re: [plugin] [ORPHAN] etz_pg for paginated articles

For the ehm, impatient, version 0.9 is out there for you to test. Read the revised documentation included in the plugin. To create a “teaser”, all you have to do is enter this:

<txp:etz_pg_custom page="1" mode="rel" link="1" />

in your article form.

Last edited by Etz Haim (2006-08-11 16:38:35)

Offline

Board footer

Powered by FluxBB