New option to prevent placeholder from wrapping content

By Michael Deroche on 27 Mar 2015
Currently, when you make a placeholder, it will wrap the content in a <div> tag.  It would be advantageous to give the user an option to have the platform not wrap the content in this container.  This reduces the amount of HTML that is injected by the platform on behalf of the developer.

If it is not feasible to place the content into the page without a wrapper, then it could be an option to remove it automatically with JavaScript after it has been rendered to the page.  jQuery's .unwrap() function can do this easily;  I've made a qick jsFiddle that outlines this process:  https://jsfiddle.net/qe5satLj/2/

If you take the following HTML (.outsystems-wrapper simulates the placeholder containing <div>)
    <div class="outsystems-wrapper">
        <p>Text Here</p>
        <button>Button Here</button>
    </div>

And run this JavaScript:
    $('.outsystems-wrapper').children().first().unwrap();

It will output this HTML, without the wrapper:
    <p>Text Here</p>
    <button>Button Here</button>

This idea has no comments yet. Be the first to comment!