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?
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 :)
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...
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...
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?
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)
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 ;-)
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
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
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...
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
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
is working on a reply...