Introduction
Topic: [keys][Improving b2evo][/keys]
Versions: [keys][1.8+][/keys]
Customise your content
Brief intro re readmore and nextpage
To use :-Upload and install the plugin : instead of using
<!--nextpage-->
now you can enter
<!--nextpage-->the chaptertext<!--endpage-->
advantage : in the old days, a mutipages post had this on the bottom of the article :
Pages 1 2 3 4
since that was not at all descriptive, not many people used it. With this plugin you can have this at the bottom :
Page contents :
- Introduction
- Download and installation
- What files need a change so this works ?
Download and installation
Installing the plugin
*Requires b2evolution 1.8 or later*
- Download this file:
_am_pagelinks_plugin.zip and unzip it.
- Upload the am_pagelinks_plugin folder to your b2evolution plugins folder.
- In the backoffice, go to Settings > Plugins and find am_pagelinks in the list. Click "install".
For this plugin to work you need to make a minor change to your skins [b]_main.php[/b], don't worry the change is coded in such a way that if you ever decide to uninstall the plugin then you don't need to undo the skin changes.
The change is very simple, just look for this line of code
<?php link_pages() ?>
and change it to
<?php
// Check if the plugin is installed
$have_pages_plugin = $Plugins->get_by_code( 'am_pagelinks' );
if( isset( $have_pages_plugin->ID ) )
{
$Plugins->call_by_code( 'am_pagelinks', array( // parameters to pass to the plugin
'before_all' => '<div class="tocWrap"><div class="toc"><p>'.T_('Page Contents').'</p><div class="list c'.($Item->main_cat_ID).'"><ol>',
'after_all' => '</ol></div></div></div>',
'before_each' => '<li>',
'after_each' => '</li>',
)
);
}
else
{
link_pages();
}
?>
That's it, you're now ready to use the custom [i]Read More[/i] and post [i]page links[/i] so wander on to the next page for details on how to use them to your full advantage
Usage
Using the new abilities
Example 1
A post with this stuff in,
This is some teaser text
<!--nextpage-->page 1<!--endpage-->
page 1 stuff
<!--nextpage-->page 2<!--endpage-->
page 2 stuff
<!--nextpage-->page 3<!--endpage-->
page 3 stuff
This will show up as
This is some teaser text
Page Contents
*1. page 1*
*2. page 2*
*3. page 3*
Example 2
page 1<!--endpage-->
This is the text for page 1 . Page 1 will show up completely. In the other links, You see a simple link to page 1
<!--nextpage-->page 2<!--endpage-->
page 2 stuff
<!--nextpage-->page 3<!--endpage-->
page 3 stuff
This will show up as
This is the text for page 1 . Page 1 will show up completely.
In the other links, you'll see a simple link to page 1
Page Contents
1. page 1
*2. page 2*
*3. page 3*
Want to show all pages of the post together? That's no problem either! You can either choose to do this on a post by post basis by adding the following line to your posts (where you want the link to show up ) :-
<!--allpages [b]Text for link[/b] -->
The [b]Text for link[/b] can simply be text like [b]Show all pages at once[/b], or even an image! It's entirely up to you! Try it for yourself, to show all pages of this post.
The other method you can use is another plugin call, this can be anywhere in your post loop and works in a very similar manner. The plugin call should be put in your skins [b]_main.php[/b] and looks like this :-
<?php
// Show "all pages" link if multi paged post
$Plugins->call_by_code( 'am_pagelinks', array( 'all_pages' => '[b]Text for link[/b]' ) );
?>
Once again the [b]Text for link[/b] can either be text or an image. This will show the link for all multi-paged posts or any post that has [i]read more[/i] text.
When in [b]all pages[/b] mode, the index is removed from the post as well, just to be aesthetically pleasing ;)
Parameters
Customise further with parameters
'before' => '<p class="tocWrap">'.T_('Pages:').'<ul>', // the code/text that should appear before the links
'after' => '</ul></p>', // the code/text that should after the linkblock
'before_each' => '<li>', // the code before each link
'after_each' => '</li>', // the code after each link
'nextpagelink' => T_('Next page') ,
'previouspagelink' => T_('Previous page') ,
'file' => get_bloginfo('blogurl') ,
'next_or_number' => 'number',
Recent Comments