dokufreaks / plugin-blog

Use DokuWiki as blogging tool
https://dokuwiki.org/plugin:blog
GNU General Public License v2.0
24 stars 18 forks source link

Flags in archive with "showhistogram" don't work #67

Open selfthinker opened 9 years ago

selfthinker commented 9 years ago

I'm not sure if this behaviour is intentional and therefore only a "bug" in the documentation or if it's unintentional and a real bug.

The documentation gives this as the example code for a blog archive:

{{archive>[namespace]?[month]&[flags]}}

But as soon as the showhistogram config option is set, the code doesn't call the pagelist plugin at all and does its own thing. Therefore it also doesn't do anything with the flags. (The name and description of the option is also misleading because it doesn't just show a histogram, but it changes the whole design and functionality of the archive.)

michitux commented 8 years ago

My guess is that it was intentional but I would consider it a bug. The showhistogram mode was implemented by a different author, that's why it doesn't really fit in the plugin. I would suggest to use the pagelist plugin for the monthly archives in the showhistogram mode. If this other list style is really desired we could also add this as an additional option/flag as a replacement for the pagelist plugin. It could also take a date format string as parameter, then it could also make sense for lists that cover more than a month.

An alternative I would also be happy with is to simply drop the histogram feature... But maybe people actually like/use it?

qwertologe commented 8 years ago

I am not sure but for me the plugins works as follows:

If you set the showhistogram option in the preferences, the histogram is used and a nice grouped layout is used (you are not able to deactivate it).

If you do not activate it in the preferences, you are not able to activate it as an option - instead a simpler variant is used (simplelist, table, ... is possible).

I use it with showhistogram because it looks nice.

I will have a look at it (especially the recommended usage of the pagelist plugin) and post again in 1-2 days...

michitux commented 8 years ago

@qwertologe But is it really the histogram you want, or is it the grouping, or is it the list in the form "date-title"? Because I think these are actually three different features. For example you could have histogram and grouping with the pagelist output.

qwertologe commented 8 years ago

@michitux No, i don't need the histogram but the grouping. I am not sure, how to achieve this with the pagelist plugin.

http://sk-schwanstetten.de/dw/doku.php?id=archiv

The code for this is simply: {{archive>news:2015-2016?*}}

I have enabled the histogram with plugin»blog»showhistogram=true and disabled it again with plugin»blog»max_months=0 :-)

This setup works without the pagelist plugin (as i recognized in this minute).

michitux commented 8 years ago

It is currently not possible, but I think the plugin should be changed to make it possible.

qwertologe commented 8 years ago

@michitux

Maybe the "showhistogram" should be changed to somethink like "bloglayout" or "internallayout". This (and updating the plugin-docs at dokuwiki.org) should clarify the things. But: This will break the sites using it... Maybe better improve the hint at plugin»blog»showhistogram:

# lang/../settings.php
$lang['showhistogram']         = '... (will activate an internal layout -> only the histogram options are considered)'

A solution for:

If you set the showhistogram option in the preferences, the histogram is used and a nice grouped layout is used (you are not able to deactivate it). If you do not activate it in the preferences, you are not able to activate it as an option - instead a simpler variant is used (simplelist, table, ... is possible).

.. would be a change archive.php:

# old (~ line 119) 
if ($this->getConf('showhistogram')) {

# new
if (in_array('showhistogram',$flags) or ($this->getConf('showhistogram') and !in_array('noshowhistogram',$flags))) {

or "hidehistogram", "nohistogram", "nobloglayout", "nointernallayout" or whatever you want...

The new flag must then be mentioned in the docs.