Same Banner Webpart Across Multiple Page Types and Page Templates

Greg Laycock asked on February 15, 2017 15:50

Good morning. I'm transitioning from using only ASPX Templates to using more Portal controls. I'm developing a site that has a number of Page Types as well as a number of Page Templates, but almost all of them share a banner format. I developed a banner Webpart which can be added to each page, but when I do so, the content for said banner is transferred to all pages that use the same template - unless I clone the template as an Ad-Hoc Template (which I'd like to avoid). Being fairly new to Portal controls, I figure I'm doing something wrong. How is this typically managed? Thanks!

Kentico 10.0, ASPX + Portal

Correct Answer

Greg Laycock answered on February 15, 2017 17:12

The same thing was happening with existing Webparts as well, Peter. I did a little more investigation and determined that this is default behavior for Webparts and I instead needed to use Widgets - which I'd formerly not used at all. As I understand them (at least in my current usage), a Widget is nothing more than a Webpart that can only be used in a Webpart Zone specified for Widget use (type Editor, for instance). When used in this way, Webparts (via a Widget) are single-use only and do not automatically transfer their data to each page which uses the same template. So I created a Widget that effectively uses my banner Webpart as-is, modified the Portal Zone Webpart Zone type, and it's now doing exactly what I wanted, that is, allowing me to add a different banner on every page.

0 votesVote for this answer Unmark Correct answer

Recent Answers

Peter Mogilnitski answered on February 15, 2017 16:25 (last edited on December 10, 2019 02:30)

Why don't you try the existing banner rotator web part. So the banners will be shown based on weight.

If you want pass some information to a web part you normally create some field in you document type, for example called MyBannerCategory. Then in form tab of a particular document you can put some value there i.e "MyCategory1" for some other document of this type you can put "MyCategory2", then you need to use macro in your banner rotator web part in category property. You put {%CurrentDocument.MyBannerCategory|(identity)GlobalAdministrator%}. Thus it will use different banner categories, when a user access these 2 pages.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.