Copied to clipboard

Flag this post as spam?

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


  • Garret 68 posts 308 karma points
    Nov 27, 2012 @ 17:05
    Garret
    0

    indenting html

    Hi all,

    Where using 4.11.0 with razor templates. When using the RTE Editor we came across the following interesting challenge.

    In the normal view we add to PageBody via the RTE Editor:

     

    If we look at the HTML view of the PageBody, we see the following:

    <p>Demo implementation</p>
    <ul>
    <li>item1</li>
    <li>item2</li>
    <li>item3</li>
    <li>item4</li>
    <li>item5</li>
    </ul>
    <p>More text</p>
    <p> </p>

    That's not very nice and tweaking the TinyMCE setttings didn't help either, but we can live with that behaviour for now:)

    What we can't live with is what happens in the site. We use @Model.Content.GetPropertyValue("PageBody") to output the html to the page. But we have no nice clean indenting there as well. We would like some indenting here.

    Any ideas of how to get this working?

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 27, 2012 @ 17:12
    Fuji Kusaka
    0

    Hi Garret,

    Not very sure of what you are trying to achive here. If you want to get ride of the html tag <p> or do you want to render html?

    Here are is whay you could try doing

    @Library.StrpHtml(Model.PageBody, "p") // getting ride of <p>
    @Html.Raw(Model.PageBody)// rendering html code

     

  • Garret 68 posts 308 karma points
    Nov 27, 2012 @ 17:17
    Garret
    0

    What i would like is that the pagebody is rendered with indenting, so:

    <p>Demo implementation</p>
    <ul>
          <li>item1</li>
          <li>item2</li>
          <li>item3</li>
          <li>item4</li>
          <li>item5</li>
    </ul>
    <p>More text</p>
    <p> </p>

    instead of

    <p>Demo implementation</p>
    <ul>
    <li>item1</li>
    <li>item2</li>
    <li>item3</li>
    <li>item4</li>
    <li>item5</li>
    </ul>
    <p>More text</p>
    <p> </p>

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Nov 27, 2012 @ 17:24
    Fuji Kusaka
    0

    I think you paste the same code twice !! can you please paste the output you would like to get?

  • Stephen Davidson 216 posts 392 karma points
    Nov 27, 2012 @ 17:24
    Stephen Davidson
    0

    I see what you mean but I'm not sure why this is important? Do you expect your CMS user to working in the HTML view of the RTE editor? For whatever reason i think the HTML view will not accomodate this.

    S

  • Garret 68 posts 308 karma points
    Nov 27, 2012 @ 19:53
    Garret
    100

    Hi Stephen,

    Were making a website with code samples for a project, offcourse we're using <pre> and <code> for nice visual code formatting.
    But we do as we advice our users and format and indent the 'real' html-code.

    We 'fixed' it by using a textarea for now! Earlier versions, could be few years ago, of tinyMCE didn't had this behaviour.

    Other ideas or plugins we can use. We looked at markdown, but it has the same issue:(

Please Sign in or register to post replies

Write your reply to:

Draft