Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support include flags for sort key and order #26

Open
ndarilek opened this issue Jul 15, 2013 · 2 comments
Open

Support include flags for sort key and order #26

ndarilek opened this issue Jul 15, 2013 · 2 comments

Comments

@ndarilek
Copy link

I have a couple different blogging scenarios on the same DokuWiki site:

  1. Traditional ordering by page creation date for a news-style section.
  2. Ordering by pagename for meeting minutes that should display in page order. 2012-06-19 should be displayed after 2013-07-14 regardless of creation time.

It does not appear that this is supported. In particular, it seems like I can set a site-wide default, but I can't specify custom sort keys/orders on each directive.

The docs claim that all include flags are supported, so I've tried using "order" but nothing changes. In looking at the code, it appears that sort order is hard-coded to read from the config and cannot be overridden by flags.

Is this accurate? If so, might it make sense to check the flags/syntaxes used by the include plugin for setting a custom sort key? I'll try modifying my local install in the next day or two to check this but it'd be nice if this change could be made globally. I'd also appreciate feedback on this change. I haven't done PHP in over a decade, know nothing about the DokuWiki code but really need to implement this change for an organization I'm trying to sell on DW.

Thanks.

@michitux
Copy link
Member

The include flags for sorting are in fact not supported, they are only for the include modes where multiple pages are included in the include plugin. What you could do, however, is using the include plugin directly instead of the blog plugin. Pagination and the add new entry form will be missing but apart from that it should be pretty much the same.

I agree that the blog plugin should also support flags for the sorting key and order. Maybe the _get_included_pages()-function of the include plugin could be used by the blog plugin, too, in order to avoid code duplication - though the getBlog()-function includes a lot more metadata in the output. Maybe the getBlog()-function could also use the include plugin's function in order to get the (sorted) list of pages and then load the additional metadata and do the additional checks only for the first X pages that are really needed.

@ndarilek
Copy link
Author

OK, for my use case I suppose I can just drop to the Include plugin for the situation where I need a custom page order, only I don't see that the include plugin lets me limit the number of pages retrieved from a namespace. Am I just missing this functionality? If not then it isn't an equivalent solution unfortunately.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants