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.

How to Make Root Categories Non-Selectable as Posting Category

edited April 2011 in Vanilla 2.0 - 2.8
Hi,

I imported my database from PHPBB3 and I now have root categories which are headings. When starting a discussion, these root headings are selectable as the post category though, something I do not want.

How can I make those root categories non-postable?

For example,

->Dogs (root heading)
-->Big Dogs
-->Small Dogs
->Cats (root head)
-->Big Cats
-->Small Cats

I do not want people to be able to select Dogs or Cats as they are just headings, but when starting a discussion the are selectable. I hope that makes sense.

Cheers

Comments

  • judgejjudgej
    edited April 2011
    Would you not edit the category permissions to remove posting rights for whatever roles are not allowed to post there?

    Now that has left me wondering, should the permissions for categories now have an additional setting: "inherit"? It ought to be possibly to set up permissions at whatever arbitrary level(s) in the categories tree and have descendant categories inherit those privileges without having to set them all up individually. This would make some forums immensely easier to set up. Unless it does already work that way in 2.0.17 (not really looked)?
  • edited April 2011
    That doesn't seem to work :(

    If I restrict permission to that root category, it applies to all underneath.

    EDIT: Ahh, I need to make special permission to each and every category. I think it's working now except that the 'headings' are not visible when selecting the category when creating a discussion (they are all just lumped together, a bit confusing/unorganized).

    (Headings not visable)

    -->Big Dogs
    -->Small Dogs
    -->Big Cats
    -->Small Cats

    I must be doing something wrong...I'll keep working on it.
  • Ok,

    So I think I am correct in saying that the category headings look as they should on the discussions page, but when creating a new discussion they are not visable from the category selector (menu thingy) making it look all unorganized as I mentioned above.

    How can I fix this?

    Cheers
  • judgejjudgej
    edited April 2011
    @Homebrew_Korea
    If I restrict permission to that root category, it applies to all underneath.
    Cool :-) I was hoping it worked like that. Can you then over-ride the permissions at the lower level categories by adding the privileges back in? [Edit: I realise that is what you have confirmed]

    The drop-down lists displaying without the categories that you can post to - I would describe that as a bug, and it should be raised as one. The categories a user cannot post to should appear in the drop-down as headings or "option groups", i.e. non-selectable items that are still displayed, IMO. So all categories you can *see* should be in that list, but only categories you can post to should be *selectable*. Here is an example (HTML can do it, so Vanilla should be able to):



    Big Dogs
    Small Dogs


    Big Cats
    Small Cats



    I'm not sure if they can be nested though, so some decisions would need to be made on how to handle a postable category two levels deep into non-postable categories.

    This, I believe, is just one of many little teething troubles for the hierarchical categories introduced in 2.0.17. Making them hierarchical is great, and a good move, but it is easy to overlook all the subsequent consequences (I'm seeing all the same mistakes made on a job site that a client's alternative supplier is putting live).
  • judgejjudgej
    edited April 2011
    Some great suggestions on how to handle nested optgroups here:

    http://stackoverflow.com/questions/1037732/nesting-optgroups-in-a-dropdownlist-select

    It seems that HTML does not support it, but most browsers do handle it. You need to add your own indenting using CSS though, which should be relatively simple if they are nested (e.g. indent 1em for each level).





    Big Dogs
    Small Dogs


    Big Cats
    Small Cats


    Stick Insects
    Beetles



    Edit: I just tried nesting the optgroups in the example above, and it did *not* work in FF. Instead the optgroups are just listed at the same level, but each one is indented using CSS to give an indication of the level.

    FYI, FF will show the indenting above, but IE8 does not. Non-breaking spaces will work more consistently, but yuk - it's not 1997 any more.
  • Hmm...

    Thanks for all of your help JudgeJ! I must admit though, the solution is getting a bit over my head as my coding skills are rather basic. It's sounding like for a consistent, one fix for all is not really possible?
  • I think one fix *will* work for all. I'm hoping all this stuff will make its way to a bug report...in fact, I'll do one now.
  • judgejjudgej
    edited April 2011
    Here you go:

    https://github.com/vanillaforums/Garden/issues/868

    That was the only remaining issue, wasn't it? You are happy that the privileges can be set to allow posting at the relevant levels?
  • Cheers. All else appears to be as it should, I think.
Sign In or Register to comment.