Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > What are the differences between 'Web part container' and 'HTML envelope' in a web part? View modes: 
User avatar
Member
Member
david.haigh-mercatosolutions - 6/14/2012 10:35:51 AM
   
What are the differences between 'Web part container' and 'HTML envelope' in a web part?
When editing a web part's properties I've noticed that there is more than likely an option to set a web part container ans also the option set an HTML envelope. These seem to achieve the same result i.e. placing content before or after the web part.

When would I use one of these options over the other?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 6/14/2012 12:55:27 PM
   
RE:What are the differences between 'Web part container' and 'HTML envelope' in a web part?
The HTML Envelope is essentially where the content gets displayed inside the webpart. For instance if you're container looked like this:

<div class="mycontainer">
<h2 class="myheader">Header Text Here</h2>

</div>

Then inside the container immediatelly after the closing h2 tag would start the HTML Envelope and would end right before the closing div tag.

Try placing some header text in the Web part container >Container Title box and then put some text inside the HTML Envelope content before and content after and see where they render. This will give you a better idea of when you might use one over the other (usually styling reasons)

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 6/14/2012 4:30:12 PM
   
RE:What are the differences between 'Web part container' and 'HTML envelope' in a web part?
Use the webpart container when you want to have a nice store of markup readily available to choose from to surround your webpart. It will also allow you to have one place to edit the markup and have it take effect on all webparts where you used the container.

It's much easier to select a web part container than to type the same HTML envelope in multiple web parts.

User avatar
Kentico Support
Kentico Support
kentico_janh - 6/15/2012 3:39:56 AM
   
RE:What are the differences between 'Web part container' and 'HTML envelope' in a web part?
Hello,

The main advantage of containers is that you specify the code only once and you can also associate it with a CSS styles to apply them only when the container is used on a page.

Best regards,
Jan Hermann