Copied to clipboard

Flag this post as spam?

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


  • Ault Nathanielsz 71 posts 317 karma points c-trib
    Jun 18, 2018 @ 14:58
    Ault Nathanielsz
    0

    store html

    I have some global settings that I want to store (e.g. footer text, etc). This will differ from site to site, and will sometimes be html... e.g.:

         <div itemscope itemtype="http://schema.org/Organization">
                        <p>
                            <span itemprop="name">Company</span><br />
                            <!-- START POSTAL ADDRESS -->
                            <span itemscope itemprop="address" itemtype="http://schema.org/PostalAddress">
                                <span itemprop="streetAddress">123 Any Street</span><br />
    etc...
    

    I could, of course, hard code it into the template, but it will be far easier for the site admin to change it as content in the global settings node.

    I am using a text area, but the output from model.content.footerArea01 has been automatically escaped (e.g. &gt; instead of <)...

    Is a textarea the correct datatype for this content? If so, how do I prevent it from being automatically escaped? If not, what should I use?

  • Marc Love (uSkinned.net) 349 posts 946 karma points
    Jun 18, 2018 @ 15:14
    Marc Love (uSkinned.net)
    101

    Hi Ault,

    Use the following

    @Html.Raw(model.content.footerArea01)

    Cheers,

    Marc

  • Ault Nathanielsz 71 posts 317 karma points c-trib
    Jun 18, 2018 @ 15:31
    Ault Nathanielsz
    0

    Excellent! thanks v. much.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies