Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Master Page Tab View modes: 
User avatar
Member
Member
William Awaji - 9/29/2011 11:48:48 AM
   
Master Page Tab
Hi

In the master page tab, in Head part i put an image for my page, with a search engine.
But i have some print pages, that cannot inherit it.

There is the problem. The code in the Head of the master page, appear in all of my pages, also with "Do not inherit any content" checked.

How to fix this?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/4/2011 5:29:09 AM
   
RE:Master Page Tab
Hello.

The reason for this is that all pages in Portal engine mode are based on CMSPages/PortalTemplate.aspx page, which is something like physical master page for all content pages. If you open this page in your Visual Studio, you can see Literal control (ID= ltlTags) here, which contains all data which you inserted to Head section on Master page tab. So, in code-behind, you can modify this content according to your needs.

But I would recommend you to use a different and easier approach – Head HTML code web part. You can place this code within it and keep in on master page only. Then, you can hide this web part on all, or selected content pages.

Best Regards,
Radek Macalik

User avatar
Member
Member
William Awaji - 10/5/2011 1:25:22 PM
   
RE:Master Page Tab
Thanks Radek, nice solution.

But i resolved by another way. In a custom webpart that i used in my print page, on the code behind i edited the PreRender event like this:



protected override void OnPreRender(EventArgs e)
{
this.Page.Header.InnerHtml = "..."
}


So, i override the header of the page, before the .net server render and show the page to the browser. =D