Copied to clipboard

Flag this post as spam?

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


  • Amigo 243 posts 568 karma points
    Mar 17, 2014 @ 22:57
    Amigo
    0

    Store html snippet

    Long story short,

    I would like to store some html snippets in the umbraco backend, that I can access from a usercontrol or razor...
    Where could save these snippets so they also can be edited via backend?

    Thanks ;-)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 18, 2014 @ 08:55
    Jan Skovgaard
    1

    Hi Amigo

    What would those snippets look like? And why do you want to store markup rather that just generate the markup based on the type of output you get?

    And who should be able to edit them?

    You could probably save html snippets in a section called "HtmlSnippets" in your content tree where you create different HTML nodes with a property of textbox where you can save the HTML.

    But I'm not sure what your scenario and reason is...so a bit hard to give some good advice :)

    /Jan

  • Amigo 243 posts 568 karma points
    Mar 18, 2014 @ 21:21
    Amigo
    0

    Hi Jan,

    Thanks for helping out again...

    The snippets are small areas of html. (a table with colmns, a div container and so on)

    What i am doing is, creating at documenttype where the content of subnodes gets merged into.
    But when creating theese subnodes the editor must be able to choose from diffrent kinds of types (that hold diffrent layouts for the same content) 

    My idea was just to grab the (layout html) from somewhere and merge the content in a usercontrol on the toplevel page.
    But im not sure where its best to store the html layout for each element (sub document types)

    It must be possible for admin to login and edit theese html snippets somewhere in the system... 

    /Thomas 

  • Amigo 243 posts 568 karma points
    Mar 18, 2014 @ 21:23
    Amigo
    0

    My idea also was:

    You could probably save html snippets in a section called "HtmlSnippets" in your content tree where you create different HTML nodes with a property of textbox where you can save the HTML.....
    I guess thats the way to do it... 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 18, 2014 @ 22:17
    Jan Skovgaard
    0

    Hi Amigo

    Could you perhaps show how your structure of document types is setup? Just so I can get a better understanding and idea on a better approach. I don't like the idea of having HTML snippets the way I mentioned above.

    Perhaps you could let the editors choose a layout on the page using a dropdown and based on that dropdown value you can decide how to wrap the content in the right html layout so the code stays in Razor/Xslt and templates where it belongs?

    /Jan

  • Amigo 243 posts 568 karma points
    Mar 18, 2014 @ 22:33
    Amigo
    0

    The structure is just a page with n subnotes of type n...

    Yea, I dont like it too thats why we here now, but it works fine, its just ugly :-)

    The dropdown is not a possibility, since the subnode documenttypes all must have diffrent content.
    Some have image+text, some have headline+image+text+link, some content from news, etc)
     

    /Thomas
     

Please Sign in or register to post replies

Write your reply to:

Draft