You are here: start » Snippets » dokuwiki » Bloglinks Plugin

Bloglinks Plugin

Description

The bloglinks plugin displays links to the previous and the next blog entry above the entries in configured namespaces. Additionally, it marks these links semantically, using XHTMLs rel=“prev” and rel=“next” and also inserts corresponding meta-headers into the created XHTML output. It needs the blog plugin (or rather its helper component) to work.

In case you come across any bugs in this plugin, don't hesitate to report them.

The Git repository of the plugin can be found at Github.

Updates

Last updated: 2008/07/07

  • 2008/07/07:
    • Adjusted to use new index format of blog plugin.
  • 2008/03/01:
    • Added config option excluded_pages to exclude pages matching a given regex from showing the bloglinks link.
  • 2007/11/06:
    • Fixed small compatibility issue with stable Dokuwiki version
  • 2007/11/04:
    • Initial release

Installation

With plugin manager

Let the manager do the dirty work, just give him this link to eat: plugin-bloglinks.tar.gz

Without plugin manager

  1. Download the plugin: plugin-bloglinks.tar.gz
  2. Extract it into your dokuwiki plugin folder (eg lib/plugins)

Configuration

The bloglinks plugin is initially configured to show the blog links only in the blog namespace. Using the configuration manager1), you can enter other or additional namespaces (as a comma-separated list) for the plugin to be active in. Additionally, you can configure the text to be used for the generated links2).The following variables can be used in this configuration setting:

Variable replaced by
@@TITLE@@ the linked entries title
@@AUTHOR@@ the linked entries author
@@DATE@@ the linked entries creation date
@@NAME@@ a language specific name of the linked entries type (eg “Previous post”)

Using a configurable regex3), you can exclude certain pages in the allowed namespaces from showing the bloglinks bar. If you for example want to maintain yearly and monthly archives of blogposts in a blog using the title prefix %Y:%m:, using the regex !^blog:\d{4}(:\d{2})?(:start)?$! would exclude these archive pages from displaying the bloglinks bar. The regex pattern has to be properly escaped and delimited. Examples for other useful regex patterns for common usecases are welcome, just add them in the comments.

1) or manipulating $conf['plugin']['bloglinks']['enabled_namespaces']
2) $conf['plugin']['bloglinks']['prev_link'] and $conf['plugin']['bloglinks']['prev_link']
3) saved in $conf['plugin']['bloglinks']['excluded_pages']

Discussion

Geoffrey RobertsGeoffrey Roberts, 2007/11/05 23:48

Bug: Fatal error: Call to undefined function page_exists() in /home/geoffroberts.net/lib/plugins/bloglinks/action.php on line 90

Any suggestions?

fooselfoosel, 2007/11/06 09:02

Argh, yes, my bad :-/… That was a last minute check I forgot to check against the stable Dokuwiki version (running devel everywhere myself). I uploaded a corrected version, hope it works for you now :-)

RederReder, 2008/02/29 06:29

Is it possible to add a syntax like

~~NOBLOGLINKS~~

to disable the bloglinks function in specific pages?

I use blog plugin and put some month archive in namespace like blog:2008:02, and the page will also display the bloglinks, which is not required.

fooselfoosel, 2008/02/29 10:17

I'll see into it, something similar just made it to my todo list anyway :-)

RederReder, 2008/03/02 06:19

Hi foosel,

I updated the bloglinks plugin and it works nice.

Thanks a lot. :D

LayneeLaynee, 2008/07/31 00:39

Thank you very much for creating and sharing this wonderful plugin ! Works great :)

sagar shahsagar shah, 2008/08/12 16:17

Hi foosel,

I am new to dokuwiki and i wanted to use Blog for my technical knowledge base so for that i wanted to know what is the syntax you use for the blog page. I created a namespace named blog but it is still showing me blank page how can i make it populate.

Thanks sagar

fooselfoosel, 2008/09/11 23:20

I use {{blog>&firstseconly}} for the blog display on the start page, and !^blog:\d{4}(:\d{2})?(:start)?$! for the excluded_pages configuration setting of the bloglinks plugin.

alsadialsadi, 2009/06/15 15:24

in RTL languages the .css should be mirrored like this

div.dokuwiki .plugin_bloglinks__prev {
	float: right;
}
 
div.dokuwiki .plugin_bloglinks__next {
	float:left;
}

could you please make to .css files one called style-rtl.css and make the your plugin check the conf to use the correct one.

Enter your comment
If you can't read the letters on the image, download this .wav file to get them read to you.
 
snippets/dokuwiki/bloglinks.txt · Last modified: 2010/01/03 15:32 by foosel