Plugin: Paginatee // Paginate text with TOC/page_titles/etc
Posted: 18 May 2008 06:32 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  637
Joined  07-02-2007

Lets you paginate an entry with table of contents (page titles) or whatever you wan to call it.

In an entry just put: {pagebreak:Some title} everywhere you would want a pagebreak, the plugin will fetch the title from the variable.



Parameters:

-current=”“
  -The content of the parameter replaces the {pgnt_current} variable
  -Ex. current=“class=‘current’” (remember to balance quotes)


Variable Pairs:

-{pgnt_text} {/pgnt_text}
  -Place in between these variables the text you would want paginated. (REQUIRED)
-{pgnt_titles} {/pgnt_titles}
  -Place in between these variables <li> or <select> etc
 

Conditionals:

-{if pgnt_pages} {/if}
  -If there are any pages. (sometimes you only have an one page article)
-{if pgnt_prev_page} {/if}
  -If there is a previous page
-{if pgnt_next_page} {/if}
  -If there is a next page


Variables

-{pgnt_url}
  -The full url to the corresponding page
  -Will only work inside {pgnt_titles} {/pgnt_titles}
-{pgnt_title}
  -The title of the page that was fetched from the to be paginated text.
  -Will only work inside {pgnt_titles} {/pgnt_titles}
-{pgnt_current}
  -If there current item is the current page. (you need to use the current=”“ paramater)
  -Will only work inside {pgnt_titles} {/pgnt_titles}
-{pgnt_current_page_title}
  -The page title of the current page
  -Will work ANYWHERE inside your template, even outside the plugin tag.
 
-{pgnt_prev_page_title}
  -The title of the previous page
  -Advisable to use with {if pgnt_prev_page} {/if}
-{pgnt_prev_page_url}
  -The url of the previous page
  -Advisable to use with {if pgnt_prev_page} {/if}
-{pgnt_next_page_title}
  -The title of the next page
  -Advisable to use with {if pgnt_next_page} {/if}
-{pgnt_next_page_url}
  -The url of the next page
  -Advisable to use with {if pgnt_next_page} {/if}

 

Simple Example:

{exp:paginatee}

<h1>{pgnt_current_page_title}</h1>

    
{pgnt_text}
        {body}
    {
/pgnt_text}

    
<ul>
        
{pgnt_titles}
        
<li><a href="{pgnt_url}" title="Page {pgnt_title}">{pgnt_title}</a></li>
        
{/pgnt_titles}        
    
</ul>

{/exp:paginatee}


Full Blown Example:

<html>
<
head><title>{title}: {pgnt_current_page_title} </title></head>
<
body>

{exp:weblog:entries weblob="default" url_title="{segment_3}"}

<h1>{title}: {pgnt_current_page_title}</h1>

{exp:paginatee current="class='current'"}

{pgnt_text}
    {body}
{
/pgnt_text}
    
{if pgnt_pages}
<ul>
    
{pgnt_titles}
    
<li><a href="{pgnt_url}" title="Page {pgnt_title}" {pgnt_current}>{pgnt_title}</a></li>
    
{/pgnt_titles}        
</ul>
{/if}

{if pgnt_prev_page}
    Previous Page
: <a href="{pgnt_prev_page_url}">{pgnt_prev_page_title}</a>
{/if}

{if pgnt_next_page}
    Next Page
: <a href="{pgnt_next_page_url}">{pgnt_next_page_title}</a>
{/if}
    
{
/exp:paginatee}

{
/exp:weblog:entries}


</body>
</
html>

Example of paginated text with titles.:
Toms Hardware

File Attachments
pi.paginatee_1.0.zip  (File Size: 4KB - Downloads: 81)
 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
EntryData
reCAPTCHA Extension
Rewrite Module


See all my EE Addons

Profile
 
 
Posted: 21 May 2008 05:22 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  637
Joined  07-02-2007

Updated to 0.2

-Fixed a variable_pair order error. Thanks Mitchell (Solspace)
-Added {pgnt_current_page_title}
Will work ANYWHERE inside your template, even outside the plugin tag.

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
EntryData
reCAPTCHA Extension
Rewrite Module


See all my EE Addons

Profile
 
 
Posted: 29 May 2008 03:50 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  37
Joined  01-29-2008

Thanks for a great plug-in. It mostly works.

The current page title only seems to work outside the tag. Is that how you intended it?

{exp:weblog:entries  weblog="test"}
<h2>{pgnt_current_page_title}</h2>
{exp:paginatee}
<h2>{title}</h2>
<
h2>{pgnt_current_page_title}</h2>

<
ul>
{pgnt_titles}
<li><a href="{pgnt_url}" title="Page {pgnt_title}">{pgnt_title}</a></li>
{/pgnt_titles}    
</ul>

{pgnt_text}
{body}
{
/pgnt_text}

{
/exp:paginatee}
<h2>{pgnt_current_page_title}</h2>

{/exp:weblog:entries}

Looks like:

First Bit (how it should read, this is outside the tag)

Test Post Paginate (post title)

{pgnt_current_page_title} (not how it should read, inside the tag)

First Bit
Second Bit
Third Bit
Fourth Bit

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus imperdiet. Mauris urna turpis, molestie sit amet, aliquet eget, condimentum eget, purus. Pellentesque consequat sagittis sem. Curabitur in lectus quis dui suscipit vehicula. Suspendisse non libero vel urna tempus cursus. ........

First Bit

Live here. Any solutions other than making sure the current_page_title goes outside the tag?

Profile
 
 
Posted: 29 May 2008 07:56 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  637
Joined  07-02-2007

Hi, i can make it work inside the tag, i will have an update for you in a couple of hours

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
EntryData
reCAPTCHA Extension
Rewrite Module


See all my EE Addons

Profile
 
 
Posted: 29 May 2008 10:57 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  637
Joined  07-02-2007

As promised:

Version 0.3
-{pgnt_current_page_title} Will work inside and outside of the tag.

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
EntryData
reCAPTCHA Extension
Rewrite Module


See all my EE Addons

Profile
 
 
Posted: 02 June 2008 11:33 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  637
Joined  07-02-2007

Updated the plugin to version 1.0

-Added parameter: current=”“
-Added variable: {pgnt_current} // works only inside {pgnt_titles}
-Added conditional: {if pgnt_pages}
-Added conditional: {if pgnt_prev_page}
-Added conditional: {if pgnt_next_page}
-Added variable: {pgnt_prev_page_title}
-Added variable: {pgnt_prev_page_url}
-Added variable: {pgnt_next_page_title}
-Added variable: {pgnt_next_page_url}

And it’s much faster now.

Bugs/Comments/Feature_Request Welcome

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
EntryData
reCAPTCHA Extension
Rewrite Module


See all my EE Addons

Profile
 
 
Posted: 25 September 2008 12:41 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Avatar
Rank
Total Posts:  37
Joined  01-29-2008

Number 1 fan here. I think a site I’m building is very dependent on this brilliant plug-in.

I’ve found a bug where if there is a question mark ? in the title (e.g: Do you like EE?) the page break doesn’t seem to register. Just letting you know.

Profile
 
 
Posted: 25 September 2008 03:36 PM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  637
Joined  07-02-2007
Embody_Bruce - 25 September 2008 12:41 PM

Number 1 fan here. I think a site I’m building is very dependent on this brilliant plug-in.

I’ve found a bug where if there is a question mark ? in the title (e.g: Do you like EE?) the page break doesn’t seem to register. Just letting you know.

Hey Bruce,

Thanks for letting me know.
I am making a new version of the plugin that includes new features. Will test your report on my new version.

-Victor

 Signature 

Truly ExpressionEngine


Fielder Module ( Mass Custom Fields )
EntryData
reCAPTCHA Extension
Rewrite Module


See all my EE Addons

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 62591 Total Logged-in Users: 13
Total Topics: 77059 Total Anonymous Users: 10
Total Replies: 416204 Total Guests: 148
Total Posts: 493263    
Members ( View Memberlist )
Active Members:    3000budulayCrucialcybermanDevStudioeejpJohnDLeevi GrahamMacDeathSimon Jobspiritbasedtosz25Turkish Baker