Forum OpenACS Development: Ajax Drop Down Menues for XoWIKI
It would make most sense in categories mode, I think. Thanks in advance for letting me know before I dig down that road myself
If I look at openacs.org/wiki, I am unable to determine in which order the pages should appear in the left navigation tree and I was wondering if there is a way to make this in a way which allows me to define, in what order they should appear.
I believe pages can be sorted by Section when using Xowiki book view. For example, note how Section 6.7 appears before 6.8 on https://openacs.org/test-doc/maintenance-web (xowiki version 0.116). Early versions appear to sort alphabetically by Page Title within a category. For example, "II.1 Structure / Mechanical" should appear before "II.2 Pod name" on http://lotusgreendatacenters.com/forge/xowiki/structure-mechanical (xowiki 0.60.3)
Something like this was done in the Content package, it is based on xowiki using categories and page_order (Section) field, this way you can sort the pages inside a category. The navigation menu uses YUI Treeview.
I'm not sure if this is what you're looking for but perhaps you'd like to check it out.
To demonstrate what I want, take a look at http://developer.yahoo.com/yui/examples/menu/topnavfrommarkup_source.html
Communication, Shopping, Entertainment and Information are "TOP Level" Categories, PIM Is a subcategory of Communication and the rest are pages, which I can order by e.g. the page section.
Hope this helps,
I think that should do what you want, or did i miss something?
As I need to change the CatTree render instproc, I would probably just generate a new class, e.g. CatMenu and add a parameter "style" or "tree_class" to ::xowiki::IncludeletClass, which defaults to "CatTree", but could also be "CatMenu", basically define the class used for the rendering. Would this be the best approach ?
You are using a boolean to differentiate between two styles and if the "other" style is true, you mixin the Categoriy::section_style. Now, if I am using the mixin approach, I still need a way to tell the categories includelet WHICH style to mixin. As you have been using a boolean, I can hardly suggest to change the "tree_style" into a string, as this would not be backwards compatible.
Luckily, the open_item parameter for add_to_category provides me with the currently open item, allowing me to render the top navigation's menu item in a different color, if the currently displayed page is in that navigation. In past projects users solved this issue by having an include (as in XoWIKI include of another XoWIKI page) for the main navigation (without drop down menues, left to right, on top of the page), which I deem not ideal, but it worked for them 😊.
Therefore the question: How can I define the mixin class to use in the categories includelet, which is the approach you would take (as I don't want to duplicate the code for the categories includelet just to be able to call a different rendering mixin class) ?
the old interface was just for activating tree style (actually an mktree-based tree-style) and the "sections" style. The classical approach in such situation is to define a subclass, which has a more flexible interface but inherits the rest of the code.
Since there is not much code involved, i have updated the interface in cvs HEAD such one can use arbitrary category renderers. One can now define an arbitrary renderer (named ::xowiki::CategoryRenderer=$style) and pass the -style to the includelet. You can define the renderer in an arbitrary -procs file. Let me know, when you need more....
PS: glad to see you back, i thought, we lost you to SAP.
As for the loosing part, my website still runs ]project-open[ and some other sites run .LRN, so I'm not gone, just a more passive follower with the occasional odd need. Though I have to admit, the SAP world is more profitable and the Drupal world provides much easier access to developers.
Regarding sorting of pages (categorized objects), this looks to be done alphabetically for each subcategory. I haven't checked the code, though. There is nothing in the data model to assist with that - category_object_map only stores the category_id and object_id - and that's probably how it should be. What's wrong with alphabetical display of wiki pages in each category?