Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Show page title in more than a page using 1 custom webpart View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 1/12/2011 9:13:38 AM
   
Show page title in more than a page using 1 custom webpart
Hi,

Currently I am using a Static Text/HTML to generate my html for the title of the page. But since the design is not final, I might have to change it everywhere again and again.

I wanted to know if it was possible to create a custom webpart that looks like:

<div class="alt-section-header"><h1>
{%currentdocument.documentpagetitle%}
</h1><ul id="breadcrumb"><li>Breadcrumb of site to be added</li></ul></div>

Is there a way to do something similar to the code above so that it shows the page title and breadcrumb in each page that I add it (so that I won't have to copy/paste 50 times)?

Thanks!

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 1/12/2011 3:53:40 PM
   
RE:Show page title in more than a page using 1 custom webpart
Hi,

you could insert one static html webpart into your master page, which is inherited by all subpages. This way you will have to change the content of the webpart only on the master page.

Alternatively, you could really create a custom webpart and insert your code into your_webpart.ascx page. Instead of macro you can set the document title in the code behind using:
String documentName = CMSContext.CurrentDocument.DocumentName;
or
String breadcrumbsName = CMSContext.CurrentDocument.DocumentMenuCaption;

Best regards,
Ivana Tomanickova


User avatar
Certified Developer v7
Certified  Developer v7
Nathoushka - 1/13/2011 8:19:27 AM
   
RE:Show page title in more than a page using 1 custom webpart
Unfortunately, not all pages must have that webpart. Also, I said "title" only, but it also contains the breadcrumb.

Indeed, I forgot I could access it within the CMSContext... I guess I'm not familiar enought with Kentico yet... Thanks for the reminder!