Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

CategoriesSimple module to add categories to the menu bar

AaronWebsteyAaronWebstey Headband AfficionadoCole Harbour, NS ✭✭✭
edited December 2014 in Vanilla 2.0 - 2.8

Note: if anyone has a suggestion as to whether the following should be a new theme or just a plugin (or both?), please let me know. I'm thinking maybe theme, since I've moved some of the menu bar elements around? I'll figure it out eventually, but if anyone feels like giving advice, I'll take it. Also if I've missed something and am just duplicating functionality, I'll buy a beer (or at least Shwaip a beer) for anyone who points that out.

I really wanted to use one of the plugins to put categories in the menu bar with drop-downs for subcategories, but I couldn't seem to get any to work as it seems none of them work with smarty (I think they don't, anyway?) on 2.1.6. I've written a module and view called CategoriesSimple that will just return

items with the categories in them. You can see a demo at http://trstri.com/forum-dev/.

Just thought I'd toss this out there in case anyone's interested in the code - let me know if so. Right now the module and view are just stuffed into the vanilla (module and view) and dashboard (view) apps, CSS is in the bittersweet theme's custom.css file, and there is still at least one bug to work out (pagination not showing up right on top of page).

Again, if anyone's interested, here's my todo:

  • pull the module/view/css out into a cloned bittersweet theme (I think that's what I should do? Or should this just be a plugin?)
  • make the category links spawn drop-down menus with subcategories (I may be using the wrong terminology here)
  • change the module name from CategoriesSimple to something like HorizontalCategories, since if I do the drop-downs it'll be less than just the simple thing I started with
  • fix the positioning of the top pagination numbers

Aaron

«13

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2014

    Try Categories dropdown plugin it sends the categories to the menu and has a drop down

    http://vanillaforums.org/addon/categoriesdropdown-plugin

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @vrijvlinder‌ I'll try again. I tried it a couple times but maybe just didn't try hard enough to get it working. Thanks! It would be so much better if I could get that to work.

  • hgtonighthgtonight ∞ · New Moderator

    I am interested in seeing the code. :)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2014

    Why does it not work for you ? That is what I would like to know :) I use it on several forums without issues...

    I will be out for dinner but will be back later..

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Aw, I knew I could count on you @hgtonight‌ :) I'll post it. @vrijvlinder‌ I'll let you know what I find out once I try again.

  • @AaronWebstey

    as an aside.
    you've also got the wrong version of file upload plugin on your forum. I don't believe 1.5.2 will work.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @AaronWebstey said:
    Just thought I'd toss this out there in case anyone's interested in the code

    @hgtonight said:
    I am interested in seeing the code. :)

    you could attack it as a zip. to this discussion

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Interesting @peregrine‌ ; I haven't been paying attention to whether the downloads on here are the most recent from github. I uploaded the version from master, saw that it didn't work, then followed your instructions from the plugin page and there ya go. Thanks! Which brings me to this aside: is the editor used on this site available to the public (and more importantly, which one it is)? So much nicer than the standard cleditor.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Here's the module (from applications/vanilla/modules) and view (applications/[vanilla & dashboard]/views/modules. Also included the default.master.tpl that I used; as you can see, if I end up making @vrijvlinder‌ 's plugin work, I'll have to figure out how to make the Members List Enhanced (or cat dropdown) use a template variable other than custom_menu, as I've moved custom_menu to the top bar so that MLE would go up there. I tossed a couple of Webstey comments into the css file where I edited that, too.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @vrijvlinder‌ the problem I'm having is that my categories are spread out across the menu bar, instead of being in a drop-down. I'm going to take another look at the discussions where you addressed that for other people.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @vrijvlinder‌ what I really would like is to have my root categories show up in the menu bar, and when you mouse over them the sub-cats drop down. I've been looking at this and its various linked and related conversations, but from what I've seen categories drop-down doesn't do this out of the box (or with small mods)? http://vanillaforums.org/discussion/23823/expand-categories-horizontally-and-move-below-menu-navigation#latest

  • @AaronWebstey said:
    Interesting peregrine‌ ; I haven't been paying attention to whether the downloads on here are the most recent from github. I uploaded the version from master, saw that it didn't work, then followed your instructions from the plugin page and there ya go. Thanks! Which brings me to this aside: is the editor used on this site available to the public (and more importantly, which one it is)? So much nicer than the standard cleditor.

    no it is advanced editor, but buttonbar plugin with markdown is quite similar.
    give you most of what you need
    along with emotiify (or emoticons can't recall which is which) and image upload and fileupload and you have basically the same thing.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @peregrine‌ yeah, I mostly really like the combo image/file upload button :) If I ever get really ambitious and have the time maybe I'll try building that myself :stuck_out_tongue_closed_eyes:

  • @AaronWebstey said:
    peregrine‌ yeah, I mostly really like the combo image/file upload button :) If I ever get really ambitious and have the time maybe I'll try building that myself :stuck_out_tongue_closed_eyes:

    theoretically advanced editor it will be released in2.1.3, so it will be a race @linc vs @AaronWebstey

    @linc since you were going to release advanced editor last summer before you ran into some issues, any chance of supplying the existing code in addons master or community.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    @peregrine‌ I have a pretty good feeling I know who will win that one :) It looks a bit like redactor.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Yeah, @vrijvlinder‌ I can't get the categories drop-down to work. Should it do what I want - allow me to list root categories horizontally, with each root cat having a drop-down containing subcats?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2014

    Ok I am back, please look at my website http://www.vrijvlinder.com/forum and hover the Cat image in the menu and tell me what you see ...

    I surmise the issue has to do with Bootstrap if that is the theme you are using.

    Yes it is supposed to work out of the box except with bootstrap because class name s are different from the default vanilla.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Yep, I can see the drop-down! I'm using Bittersweet though, not bootstrap. Could that be a problem? Also, if I can get it to work, will I be able to list categories horizontally, like in my demo at http://trstri.com/forum-dev/ but with a drop-downs for subcategories?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited December 2014

    You can change how they display via css.

    If you want them to display horizontal, you use display:inline-block; instead of display:block; for ul li ul li

    It is easy to do this even by using only css. This plugin relies on jquery to operate the dropdown.

    I do know that this may not work with tpl based themes because of the jquery. But that can be fixed by only using css to make the dropdown operate.

    You can try my BetterBitter theme based on bittersweet but in php and that for sure works with this plugin and others.

  • AaronWebsteyAaronWebstey Headband Afficionado Cole Harbour, NS ✭✭✭

    Ah, perfect! Thanks very much! Now I know where to start at least.

Sign In or Register to comment.