Quantcast
Channel: OutSystems Community
Viewing all articles
Browse latest Browse all 1476385

[Ideas] New option to prevent placeholder from wrapping content

$
0
0
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>


Viewing all articles
Browse latest Browse all 1476385


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>