Copied to clipboard

Flag this post as spam?

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


  • Thomas Michael Koch 24 posts 96 karma points
    Jan 25, 2015 @ 14:12
    Thomas Michael Koch
    0

    Static HTML in property

    Hi - I am in the proces of designing a new umbraco 7 site.

    What I would like to have, is the ability to enter a raw HTML fragment in a property on a document type instance.

    Does anyone know how this can be done?

    I have often battled with the RTE but frankly I hate it. It keeps modifying the HTML I enter.

    Kind regards

    Thomas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 25, 2015 @ 14:59
    Jan Skovgaard
    0

    Hi Thomas

    What is the scenario for needing to insert HTML snippets?

    The RTE is not the way to go about it imho - But you should be able to somply use a textbox multiple property editor, where you just paste the HTML and then render it using Razor, Umbraco.Field or however you render your pages.

    /Jan

  • Thomas Michael Koch 24 posts 96 karma points
    Jan 25, 2015 @ 15:25
    Thomas Michael Koch
    0

    Hi Jan - thanks for the reply.

    The scenario is that I am using a bootstrap based template, and me and the people editing the content on the site, need to "find our legs" with the new css classes.

    Instead of spending a lot of time creating special template pages, I will start out by creating layout page, with a single content property, where I can simply enter an HTML fragment.

    I will need to enter divs and other HTML tags. Wont the textbox-multiple strip div tags?

    Thomas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 25, 2015 @ 15:34
    Jan Skovgaard
    100

    Hi Thomas

    Ok, in that case I don't recommend using the approach described above.

    You should consider using partial view macros instead, which will render for instance a navigation block or other page components like the header, footer etc. depending on what your site architecture is.

    Maybe you can benefit from watching some of the Razor videos on umbraco.tv here http://umbraco.tv/videos/umbraco-v7/implementor/working-with-umbraco-data/razor-syntax/introduction-to-razor/

    You can also learn more about Razor based macros here http://our.umbraco.org/Documentation/Reference/Templating/Macros/Razor/index

    /Jan

  • Thomas Michael Koch 24 posts 96 karma points
    Jan 25, 2015 @ 15:35
    Thomas Michael Koch
    0

    Hi Jan - many thanks for the links. :-)

    Thomas

Please Sign in or register to post replies

Write your reply to:

Draft