Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Funka! 398 posts 661 karma points
    Jul 27, 2012 @ 23:54
    Funka!
    1

    Recommendations for improving uBlogsy Categories

    Hi there! Wanted to first start off by saying Anthony, this package is great! I've been thinking about some ideas for improving the categories functionality and wanted to propose the following for perhaps incorporating into a future version.

    I started off making these changes in a sample site in order to take the following screenshots; didn't actually write any of the Razor scripts that would likely be needed for this, but hoping these will be trivial enough at this point, or at least no more difficult than what's already in place.

    The idea is to improve upon the category functionality. As you know, right now, the only way to manage categories is in the Developer section, by adding/editing pre-values on the data type. My suggestion is to move the categories into the content tree, which has the following advantages:

    • The end-user will be able to add, edit, or remove their own categories.
    • Categories become actual pages with their own URLs that you can make "pretty" via the UrlName.
    • (This also allows the end-user to choose alternate/shorter URL paths instead of having to UrlEncode in the querystring.)
    • This also means, you can add some body text to the tops of these category pages if you want.

    I started to document the changes I made to achieve the following screenshots. I'll include those notes further below.

    First of all, here's what my content tree looks like now after creating a few Sample Categories:

    The new "uBlogsy - Category" document type inherits from uBlogsy - Base Page, just like most of the other types. Thus it is just another regular node allowing you to give it additional content, whatever UrlName you would like, etc.

    I created a new Ultimate Picker datatype, which can replace the existing Category Selector:

    And then updated the uBlogsy Post document type to use my new dataype, which as you can see looks just like it always has:

     

    I unforuntately have only made it this far (the idea and prototyping stage), but hopefully the rest is intuitive enough. (Creating templates and razor scripts, modifying existing uBlogsyListCategories.cshtml script, etc.)

    Here are the notes I have so far on this. If I'm able to make any more headway on this, I'd be happy to share my results. I appreciate your taking the time to review this, and wanted to thank you again for your time on this project.

     

    NEW DOCTYPES NEEDED: (trying to follow your naming conventtion here)
      * "uBlogsy - Container : Categories" (Inherits from "uBlogsy - Base Page", using famfamfam "folder_star.png" icon)
      * "uBlogsy - Category" (Also inherits from "uBlogsy - Base Page", using famfamfam "star.png" icon)

    NEW DATATYPE NEEDED:
      * "uBlogsy - Category Picker" (create as built-in "Ultimate Picker" type, of type "CheckBoxList", with "Parent nodeid" matching whatever value of your category container node's ID.
     
    CAN DEPRECATE:
      * The uBlogsyPostCategories property on the "uBlogsy - Post" document type, and the "uBlogsy - Category Selector" datatype itself
     
    OTHER IDEAS:
      * For better performance, could make use of the uComponents "MultiPicker Relations" so when you visit a Category page, you have convenient index of related posts instead of having to drill through all post nodes each time.
      * (This of course would require uComponents as a prerequisite for umbraco 4.7.2 and earlier. And is included by default in 4.8 and above of course.)
      * I also considered using the (uComponents) Multi-Node Tree Picker to select the categories, but the built-in Ultimate Picker works well enough for this.

     

    Thanks again!

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 30, 2012 @ 12:44
    Anthony Dang
    0

    Thanks for the suggestion.

    I was considering doing something like this... A lot of people are wanting to have the posts under a category node because they're using it as a news package. So I have to think about how best to do all of this.

    I have tried to stay away from other package dependencies because packages can change etc.

    I might have a think about doing the tags like the categories you suggested.

    Thanks again for the suggestion.

     

  • Funka! 398 posts 661 karma points
    Jul 30, 2012 @ 20:59
    Funka!
    0

    I agree with a concern about depending on other package dependencies. However with uComponents now being included in umbraco v4.8 as part of the core, it seems like a "safe" thing to depend on moving forward. (But maybe wouldn't be as suitable for people upgrading on older installations, I understand.)

    My main motivation for improving the categories is (well, besides giving our authors/editors control of them without having to go into Developer section) is simply to have better control over the URLs.

    I posted a few weeks ago about a problem we ran into with ampersands in a category name. Even with the suggestion to UrlEncode these still results in some fairly convoluded URLs, especially when other characters start appearing in the "friendly name". A category named "Lorem & Ipsum - Dolor Sit Amet" for example results in a URL called /blog/?category=Lorem+%26+Ipsum+-+Dolor+Sit+Amet  when we would love instead to have something like /blog/categories/lorem-ipsum/. And although we don't really care about the order they appear in, it occurs to me now you would also have that control with such a scheme.

    Anyways, thank you for your time in considering this. We aren't really using the tags functionality but I can see how something similar to this suggestion would work just as well for those!

    Thanks again!

     

  • Kiran 4 posts 24 karma points
    Sep 17, 2012 @ 11:00
    Kiran
    0

    Hi funka,

    I had followed your steps of making categories editable to end-users, but  failed to display the actual Category names on webpage, instead it shows the contentnodeid

    of the categories

    like this:

    please help us out!!!!

    thanx in advance

  • Funka! 398 posts 661 karma points
    Sep 18, 2012 @ 19:51
    Funka!
    0

    Hi Kiran,

    It looks like you just need to find where those IDs are being output and wrap a function or helper around them to instead display the category name.  However, I think even once you get these to display how you want, you'll still have other related chores such as how to handle those links once you click them. (For example, you probably don't want to change just how they look but also the underlying NiceUrl to the category.)

    One place to start might be at the bottom of uBlogsyListCategories.cshtml, and look for the drawCategoriesList helper. So instead of:

    <li><a href="@[email protected](c)" title="@c">@Html.Raw(c)</a></li>

    Perhaps try this?

    <li><a href="@Model.NodeById(c.Id).NiceUrl">@Model.NodeById(c.Id).Name</a></li>

    But like I said, this will require more work such as how to handle things at the URL this would point to. Anyway, good luck to you!

  • Kiran 4 posts 24 karma points
    Sep 20, 2012 @ 13:24
    Kiran
    0

    Thanks a lot .. :)

Please Sign in or register to post replies

Write your reply to:

Draft