ASPX templates
Version 7.x > ASPX templates > Custom webpart with CMSRepeater widget not loading SelectedItemTransformationName View modes: 
User avatar
Member
Member
mark.wiseman-revium.com - 2/6/2013 8:42:35 PM
   
Custom webpart with CMSRepeater widget not loading SelectedItemTransformationName
I have created a Webpart (an widget) that contains a CMSRepeater to show News Items below the current node.

The transformation specified in TransformationName shows all the child items fine.
When i click on a link to view the full new item I am seeing a blank page.
Kentico is displaying the item as its own page instead of invoking the SelectedItemTransformationName transformation of the parent page.

When I hard code the CMSRepeater into the page template it works fine.

Is it possible to make this work?

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/11/2013 5:08:37 PM
   
RE:Custom webpart with CMSRepeater widget not loading SelectedItemTransformationName
Hi,

If configured properly, the detail transformation is called in the child node (and its own page is used as you describe) and thanks to the template inheritance, it can work.

How do you setup the page template inheritance? Which page template is shown for the child (news) items?

The alternative approach is to have two web parts / widgets together with using Visible or Display for Document types property to show only one.

Regards,
Zdenek

User avatar
Member
Member
mark.wiseman - 2/11/2013 5:57:42 PM
   
RE:Custom webpart with CMSRepeater widget not loading SelectedItemTransformationName
I have:
- A page template named TwoColumns
- A webpart / wigdet named NewsList

Site Structure:
- News Page (Template: TwoColumns, Doc Type: Page (menu item))
-- New Item 1 (Template: Inherited, Doc Type: News)
-- New Item 2 (Template: Inherited, Doc Type: News)

Via CMS Desk i have added my widget to the News Page using the content editor.

When i view the "News Page" i see a list of news items
When i view "News Item 1" i see a blank page that looks like the template TwoColumns.
If i add content to on the Page Tab of "News Item 1" i see that instead of the news.

Like i said above, if i add the webpart to the source of the template then when i view "News Item 1" i see the template TwoColumns with the SelectedItemTransformationName results.

I would rather not hard code the control into my page template if i can help it.
Is it possible for a widget to work the same way?

Thanks

User avatar
Member
Member
mark.wiseman - 2/17/2013 8:12:30 PM
   
RE:Custom webpart with CMSRepeater widget not loading SelectedItemTransformationName
Because there is no reply i am assuming that this is not possible and i have to create a different page template if i want to use a CMSRepeater

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/20/2013 3:37:52 AM
   
RE:Custom webpart with CMSRepeater widget not loading SelectedItemTransformationName
Hi Mark,

So, to understand correctly, you have added your widget in some editable area using the WYSIWYG editor? Or have you added it through Design mode into some Widget zone?

The widgets added in an editable area using the editor are User-widgets and they're available only on the given page...

By hardcoding the control, do you mean into the Page template layout, or just a WebPart in the Design mode? Is it a problem for the News list and detail pages scenario?

Regards,
Zdenek