WordPress.org

Ready to get started?Download WordPress

Forums

Sub-Categories, at last, BUT.... (24 posts)

  1. TechGnome
    Moderator
    Posted 10 years ago #

    At long last, there are sub-categories in WP. Some may not see why it's needed, but it'll help me on keeping related things organized. At any rate, I'm having a bit of an issue with sub-categories.
    I created a new category and set its parent to an existing category. I then took two existing posts, which were in the parent cat, and moved them to the sub cat. View the site, and I see now that the sub cat appears in my category link listing. Cool, I click on it...... I get my main page. WTF?
    What's going on is that I have the parent cat excluded ($cat = "-2";) from the main page... when I took that out, the link to the sub cat worked as expected, except now the posts shows on the main page, which I don't really want.
    For now I will settle for having it on the main page, since it's the next thing to fall off any ways, but if someone could take a looksie and see what's going on, that would be great.
    TG

  2. TechGnome
    Moderator
    Posted 10 years ago #

    Aaand... when I edit a category, if it's the top category.... there's no way to maintain it as the top category....
    TG

  3. webicus
    Member
    Posted 10 years ago #

    Are Sub-categories implemented in WP 1.0.1 miles?! Thought they are planned for version 1.1 ... So, how did you define a category as a parent for another via the interface?
    Another question: Are categories ordered by comments? f.e. <!-- 1 cat --> Ontopcat

  4. TechGnome
    Moderator
    Posted 10 years ago #

    I don't know if it's in Miles, but it was in last night's nightly (1-28-2004). As for setting the parent cat... it's rather simple. Either Edit and existing category, and there is a drop down box to set the parent. BE CAREFUL! If you go to edit the parent category, there is no way at the moment to keep it as such, it will want to move it.
    For adding a new category, there is a drop down there as well.
    I'm not sure I get your last question regarding comments.
    TG

  5. antifuse
    Member
    Posted 10 years ago #

    Subcategories aren't in 1.0.1 Miles... but they ARE (in a rudimentary form) in the nightly builds.

  6. webicus
    Member
    Posted 10 years ago #

    @TechGnome
    Thats one solution for category-listing:
    Every Cat. get a comment with a digit.
    <!-- 1 -->Category A
    <!-- 3 -->Category C
    <!-- 2 -->Category B
    Result in a list displayed like this:
    Category A
    Category B
    Category C
    Got it? Is this the only way to (re-)order
    the category-list? But - it works...
    ------------------------------------------
    Nightly builds?! I sleep at night.
    I am not Coffee Anan. ; )

  7. Lester Chan
    Member
    Posted 10 years ago #

    yeap i tried the sub cats... i find it used up a little bit more queries

  8. Jason
    Member
    Posted 10 years ago #

    Seems the "none" option got lost for parent category... shouldn't be too hard to fix.
    I'll take a look at the exclude problem this evening.
    As for queries, we're working at keeping them as low as possible...

  9. TechGnome
    Moderator
    Posted 10 years ago #

    GamerZ - yeah, I noticed that too, my page times have gone from less than .5 seconds to about 1.73 seconds.... But I can't complain too much. It's still fairly quick.
    webicus: It took me a while, but I think I got it now... AFAIK categories are sorted by their name, so by manipulating the name, you can resort them. I think there are also other options to sort by (like by ID) but I don't know what they are. If the comment thing will work or not.... I don't know.... somehow I don't think so, since it gets rendered as a link at the same time. Try it and find out.
    TG

  10. Alex King
    Member
    Posted 10 years ago #

    If the sub-cats are slowing down performance, we definitely need to find a way to bring them up to the current speed or introduce an option to disable them for users that don't want to use the feature.

  11. Jason
    Member
    Posted 10 years ago #

    My testing of Miles and the nightly are as follows:
    Miles: avg 0.027 seconds
    nightly: avg 0.032 seconds
    Of course, this is my test install which has only the default entry. I'll work on doing some more in depth testing once I've added some dummy entries.

  12. Lester Chan
    Member
    Posted 10 years ago #

    The queries count is still quite okie, just extra 2 queries. But from the look of the code on the admin site, it looks like it will be alot.
    Wonder if this sub-cats code will help: http://www.lesterchan.net/files/subcats.txt

  13. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Reading the entire category structure into a global array and recursing over the array (instead of the database) would be a very logical next step.

  14. Lester Chan
    Member
    Posted 10 years ago #

    yeap =D

  15. Jason
    Member
    Posted 10 years ago #

    Just about finished with fixing the admin to use arrays instead of the DB. Once I'm statisfied it works, we'll be all set.
    TechGnome: Are you still experiencing slowdown from sub-cats? Looks to me like you're back at .5-.6 seconds.

  16. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Yes, if you're posting on relative slowdowns try to control the enviroment as much as possible to eliminate other factors. Of course this can be hard for many people, so don't worry too much about it.

  17. jennat
    Member
    Posted 10 years ago #

    I'm very new to WP and this PHP thing, so I have many questions. These nightly builds: how do we install them? And the subcategory drop down menu mentioned above? It's not in my installation, v. 1.0. Help? Please?

  18. webicus
    Member
    Posted 10 years ago #

    @jennat
    Take a look here: http://wordpress.org/nightly/
    Just configure your wp_config.php and replace the other files.
    @devs
    I stopped at b2-evolution and found a good subcategory-handling:
    http://www.opensourcecms.com/b2evolution/admin/b2categories.php (admin/demo)
    Can this be made with/for WP? Nice: The subcategory is also recognized as a subcat in the
    edit-view (subcategory = sublist between the major category-list).

  19. Anonymous
    Unregistered
    Posted 10 years ago #

    I made a quick comparison between WP an b2-evolution. Some parts of b2 seem to be very cool especially the display of subcategories and their handling in posting/editing-mode. Looking at the nightly-builds these options seem to be a scribble yet. But, the worst thing in b2: Smilies in every colour and looking. I really, really hate smilies >8-(;)

  20. Jason
    Member
    Posted 10 years ago #

    Hmm... you really like the subcategory interface in b2? It seems a little messy to me. I'm very happy with the interface that Matt put together...
    for those that haven't seen it (i'm not sure if it's in the latest nightly or still only on CVS), current categories are listed like this:
    Parent Category
    -- Subcategory
    ---- Even Deeper
    -- Subcategory
    -- Subcategory
    Another Parent
    -- Subcategory
    and when creating/editing a category, there is a dropdown box for choosing the parent which displays the categories in the same way.

  21. TechGnome
    Moderator
    Posted 10 years ago #

    I too am very happy with the way sub cats came out in WP. I implemented them last week some time and haven't had any issues with it.
    TG

  22. Anonymous
    Unregistered
    Posted 10 years ago #

    I have to aggree - the new listing of categories is usefull. But theres no hierachic view in Post/Write or Site-View. Just a normal list of categories. Hierachic view in Post/Write is no must-have, but absolutely in Site-View or subcategories make no sense at all. How can the display of subcategories be handled so they are recognised as subcategories?
    Another point: I wasn't able to add a new parent-category via Add/parent-category=none (nightly 0202).

  23. TechGnome
    Moderator
    Posted 10 years ago #

    Ok, I've run into my first big problem with the sub categories.
    Normaly, in WP, clicking the title brings up that post using the permalink.... and it works OK, until I click the title of a post that's in a sub-category. It tells me "Sorry, no posts matched your criteria."
    Any clues?
    TG

  24. Jason
    Member
    Posted 10 years ago #

    TechGnome: Works fine for me. I think it might have something to do with you excluding the parent category. I'll work on it.
    Anonymous: By site-view, do you mean on the blog? There's an option in list_cats to display categories hierarchically. As for nightly 0202, I'm not sure what the problem is. I'll take a look.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.