The next version of Habari will have taxonomy support, allowing for
the description of all sorts of relationships between objects, and
there will be a subpage plugin that uses that. There is actually a
subpage plugin at the moment that lets users define a page as a child
of another page, but it's incomplete and not production ready.
> * There is no easy way to order the pages. I know it can be done by
> modifying the publication date but this doesn't fit that ease of use I
> mentioned above. Seems overly complicated for a client to have to do that
> just to order a few pages.
I'm not really sure what you mean here. How and where do you want to
be able to order pages ? In a way, pages are designed to be standalone
for display rather than ordered. There is a page menu plugin that's
specifically for ordering page menus.
You can also pass an orderby parameter to Posts::get() that can order
by any column in the database. A silly example.
Posts::get(array('content_type'=>'page', 'status'=>'published',
'orderby'=>'title DESC'));
It may be that taxonomy is the answer to your page ordering issues too.
> Otherwise, wow, genius!
I have nothing to say to this point, but I can't snip it :)
--
Michael C. Harris, School of CS&IT, RMIT University
http://twofishcreative.com/michael/blog
IRC: michaeltwofish #habari
Hi Michael,
Thanks for taking time to reply.
That is great to know that the page nesting is coming up. I don't think we can use habari for our clients until that's in. looking forward to it.
Is that going in version 0.7?
In regards to the ordering. I agree with you that some ordering can be achieved by using the right query, but that's a fairly rigid implementation. There should be some easy way for a client, as a site admin, to choose an arbitrary ordering that's not based on a content field like the title or the id or the publication date.
Habari will probably not have a "page order" field. The in-development
code for Taxonomy allows the system to define multiple MPTT (modified
preorder tree traversal) structures that describe trees of organization.
Each of the structures in the taxonomy is called a "vocabulary" and has
a name. A Vocabulary can be defined with a required one-to-one
relationship with posts.
What this lets you do is define a Vocabulary named "products", and then
create a tree of Posts, each with its own title (it can just be the
Post's title, or it can be something else entirely). Using the
functions in the Taxonomy-related classes, you should be able to
retrieve a list of posts that have been associated with that vocabulary,
and in an order that allows you to build a menu or a structured
ul/ol-type list.
The call for Posts::get() should also be modified to return posts that
qualify for specific taxonomy characteristics, but will probably not
return posts in a tree structure (although they may be properly
ordered). A separate call (as I mentioned above) using
Vocabulary::get_term() will return a term that has methods to iterate
through the tree of that vocabulary and obtain the linked Post to each
term. A helper method like Vocabulary::get_object_tree() could probably
return the Posts with an ordered "children" property.
The evolving API definition for Taxonomy is here:
http://wiki.habariproject.org/en/User:ringmaster/Taxonomy
The implications of this are that you could create multiple
vocabularies, one for each menu you want to create. Each vocabulary can
contain any posts, so a post can exist in a single menu more than once
and a post can exist in many menus.
You could do crazy things with this system like build one primary menu,
then build multiple secondary menus, and only display one secondary menu
based on the Scope (using our blocks/areas/scopes features) of the page
displayed.
As an example, if you're Nike, you'd have a primary menu with "Shoes"
and "Sportswear", which are also complete secondary menus unto
themselves. When displaying pages that qualify in the "shoe" scope, you
could display the "Shoes" secondary menu in a sidebar block, and
likewise use the "Sportswear" secondary menu instead on a page showing
basketball shorts.
Building the underlying system properly is really important to us right
now. What you'll find missing in the system so far is a way to use the
UI to set any of this. Suggestions for this are welcome, although I
think for our first iteration (although the more I think about it, the
more I think this may be a permanent condition) the only UI for Taxonomy
will be via plugin. That means that if you want a menu that you can
configure, you'd activate a plugin for that.
Eventually, we'll probably include a default menu plugin in the
distribution, but because the system I've described above is so
flexible, we'd want to give users the option to disable any native menu
system completely to replace it with a custom system that either comes
pre-packaged from the extras repo or from a custom code developer.
The conversation I've had many times with many people is that "Taxonomy"
as an idea is much too complicated to expose some kind of generic
interface and let the end-user sort it all out. We'll include some
basic plugins that make use of the underlying system, but we'd probably
be well off to never have an interface element that says "Create a new
vocabulary", since that could mean many things depending on how it's
implemented.
I hope that gives some impression of the plan that we're trying to
implement with sub-pages and navigation. There are still some sticky
bits, as I said, with UI and also with URLs. I know everyone says that
they want /grandparent/parent/child URLs, and figuring out a clean way
to both allow and generate those (and in my opinion, whether you'd even
need them) is also an interesting challenge.
Pitch your ideas here.
Owen
As with all of the features in Habari already like this (undelete, core
dashboard modules, local media silo, pingback, etc.), this feature
should be a plugin that the installer suggests to enable by default.
I think it's sad that we've already got "tags" in core (which will use
the Taxonomy API) that we can't remove that to a plugin also when
Taxonomy is complete. It's a feature I'd love to implement in a
different way (like, omitting the tags admin page entirely).
Subpages are a mere subset of the functionality of Taxonomy. By their
nature, they don't demonstrate the full force of the underlying feature.
There will always be something better, or something more custom
required, and I can't imagine a default UI (perhaps that's my
limitation, but I suspect it's not) we could design to accommodate all
of those alterations.
Owen
[snip]
> Subpages are a mere subset of the functionality of Taxonomy. By their
> nature, they don't demonstrate the full force of the underlying feature.
> There will always be something better, or something more custom
> required, and I can't imagine a default UI (perhaps that's my
> limitation, but I suspect it's not) we could design to accommodate all
> of those alterations.
After having worked on and thought about the taxonomy system and a
subpages plugin for a while now, I agree with Owen. A generic 'Manage
Vocabularies' page wouldn't be useful, because in and of themselves
vocabularies aren't useful, they need something extra. The appropriate
place for that extra is in a plugin, which needs to supply its own UI.
As things stand, the subpages plugin doesn't use a UI at all, there's
simply a drop-down in a Page's settings tab where you can choose a
parent. I can see that a hierarchical drag and drop would be a useful
addition to it, but I don't think core is the place for it.
I think with tags reimplemented as a taxonomy, and a subpages and
maybe pagemenu plugins, that would be a good suit of examples.