Copied to clipboard

Flag this post as spam?

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


  • Nathan 16 posts 38 karma points
    Oct 01, 2009 @ 05:27
    Nathan
    2

    How to eliminate html reduncancy within templates.

    What's the best way to remove html redundancy.  I am very familiar with the master page concept, but for some reason I don't see how one would encapsulate a repeatable bit of text w/o placing in your root document type.  Do people ever use xslt for non-repeatable content output?

    With non-Umbraco projects, I usually create a project and add user controls to encapsulate some functionality (like a module; in the non-vb sense of the term).  I obviously wouldn't want to use user controls for this purpose in Umbraco.

    So, lets say I have contact information that lives in a module in the right hand column of a site.  There are several templates and I want to be able to add that content to several template.  I see 2 options: create an xslt with the static content and add the module to my template or add the properties to the root document type and add the field recursively to the template.  The first option isn't a good solution because end users won't be able to edit the content and the latter solution isn't extensible enough.  What if I had 10 modules?

    Ohh, I have an idea after typing this out, but I'd like to hear other thoughts as well.

    Thanks,
    Nathan

  • Petr Snobelt 923 posts 1535 karma points
    Oct 01, 2009 @ 08:26
    Petr Snobelt
    1

    You can create module datatype, create template for it and then create macro, which use umbraco.library RenderTemplate

  • Nathan 16 posts 38 karma points
    Oct 03, 2009 @ 19:02
    Nathan
    0

    Thanks for response Petr, any chance I could talk you into elaborating on how that would.  I'm a n00b.

  • Chris Koiak 700 posts 2626 karma points
    Oct 04, 2009 @ 10:32
    Chris Koiak
    1

    Hi Nathan,

    Could you create the functionality as a usercontrol, then wrap that up as a Module. The module would have the parameters that you wish the editor to specify. You would also enable 'use in editor' checkbox. This would then allow the user to inject this functionality into any defined RichTextArea.

    If you want to centralise some config content then you could create specific settings section in you content tree. For example:

    Content
    -- Website
    -- -- -- Home
    -- Settings
    -- -- -- Module 1 Settings
    -- -- -- Module 2 Settigns

    Cheers,

    Chris

  • Nathan 16 posts 38 karma points
    Oct 06, 2009 @ 05:16
    Nathan
    0

    Thanks Chris, I thought about that approach, but the user control seems like a bit of an overkill.  I also like the latter suggestion and still might try something like that out.  Maybe have a right hand side tab that allowed them to select modules in the RichTextEditor.

    I ended up using this technicique http://bit.ly/7aFl  This still seems way to complicated for such a common requirement.

    Thanks,
    Nathan

Please Sign in or register to post replies

Write your reply to:

Draft