Copied to clipboard

Flag this post as spam?

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


  • MRL 1 post 21 karma points
    Oct 23, 2010 @ 11:47
    MRL
    0

    Best practice for document types without templates?

    We seem to be creating a lot of document types that will never need to use rendering templates, for example: image gallery items, news items where the article is a PDF (so no detail page req'd), simple shopping cart items where no product detail page is needed, etc etc etc.

    The problem is, our navigation XSLT's are getting our of control with all the doc types we need to exclude.

    So what's the best way to approach this?

    The options I see are:

    1. Add an 'umbracoNaviHide' property to each of these 'item' doc types.
    This works, but requires an additional option to be selected by content editors, and such is prone to mistakes.

    2. Add a string comaprison rule in our navigation XSLT's that automatically exclude any nodes where the doc type includes the string "Item". This is however also prone to creating problems, as there's likely to be future doc types where including "Item" in the name just makes sense and we may need them in the navigation markup emitted..

    Unless there's some way we could force 'umbracoNaviHide' (or some other similar flag) on each of these "Item" doc types that wouldn't require user interaction?

    I'm curious to hear how you long-time umbraco user's have approached this type of scenario.. :)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 23, 2010 @ 12:19
    Jan Skovgaard
    0

    Hi MRL

    I'm just wondering why you are creating items to handle images and files? Would it not be possible for you guyrs to make use of the media section for this?

    Then content could be structured into folders. This gives you the opportunity to select at whole folder with the media picker, and create a gallery with the images in the folder. You also have the opportunity to create file lists etc. and off course just select single files where needed.

    This is just meant as inspiration if you have not already thought of doing it this way.

    And now to the options you listed

    1) I would probably go for this solution - as it is it's not perfect because it will create too much work remembering to mark that the site should not be in navigation. Therefore I would install the Standard Value package, which extends the "settings" section and allows you to, yup you guessed it, set standard values. In this section you can make sure these items are always hidden from navigation.

    EDIT: you find the mentioned package here http://our.umbraco.org/projects/developer-tools/standard-values-in-umbraco

    2) I agree, this would be a bad solution, which will be hard to manage as your project evolves.

    Hope this helps

    /Jan

  • Eran 292 posts 436 karma points
    Oct 23, 2010 @ 14:34
    Eran
    0

    Hello MRL,

    i think that Jan is right,the best practice is to use the media section for "simple" items that not required document type.
    the problem with this approach is that sometimes you want to add properties and info to each item and image type etc. is just not enough.
    in this situation you have 3 choises as far as i see it:
    1. use document type - this is what you do now and you know what is the problem with it.
    2. add more fields to the media types.
    3. use the repeatable custom content package. its perfect for this kind of job. think of it like a table that each row contains item and each column contains the item  
        property. you  can add/remove rows. (instead of add/remove nodes).

    BTW, i think that the main advantage to use document types for "simple" items is mainly to keep it simple for the client. he is already knows the concept of adding new nodes to the tree, how to right click and "create" new nodes. so like he creates new content and pages, he can creates new items like images. he dont need to learn how to use new controls etc. this is important.

    Eran.

Please Sign in or register to post replies

Write your reply to:

Draft