Article List customization.

Aashish Khandelwal asked on January 13, 2015 15:36

Look at the website Take A Challenge. I want to customize the Article List webpart such that :

  1. After every two Articles, Banner Rotator will get placed.

Regards
Aashish Khandelwal

Correct Answer

Roman Hutnyk answered on January 13, 2015 21:18

Aashish,

This could be achieved by using two transformation: - one, that is currently in use; - the copy of current transformation, but you'll need to add control (e.g. nested repeater) for banner rotator there. Specify this transformation as an alternative transformation.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on January 13, 2015 19:42

Don't think this has anything to do with the Article List webpart, because it's based on the Repeater webpart. I'd create a custom query OR create your own webpart based on a repeater that allows you to set via properties how often you want to "inject" a different doc type in and what that doc type is and the transformation. Probably a better solution all around.

2 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 14, 2015 05:00

Not sure that will work as Aashish wanted Roman because he wanted after every 2nd item to place an ad. This will only do this every other item. Also, nested repeaters work (and I use them as a last resort) although raise performance concerns. Even Kentico recommends not using them.

0 votesVote for this answer Mark as a Correct answer

Aashish Khandelwal answered on January 14, 2015 15:27

Roman, is there a way I can change the alternate Transformation to get rendered after every two items?

Regards
Aashish Khandelwal

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on January 14, 2015 15:57 (last edited on January 14, 2015 15:57)

Aasish, specifying transformation and alternative transformation should give you expected result.

0 votesVote for this answer Mark as a Correct answer

Aashish Khandelwal answered on January 15, 2015 09:07

Thanks Roman Hutnyk,

Your approach works well for my scenerio.

Regards,
Aashish Khandelwal

0 votesVote for this answer Mark as a Correct answer

Aashish Khandelwal answered on January 15, 2015 15:42

Roman Hutnyk,

What if I would have to display Banner Rotator after three Items?

Regards,
Aashish Khandelwal

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 16, 2015 06:09

That's where the solution I suggested Aashish would work better. You can specify which page types and how frequently you wanted them to repeat. Using the Alternative Transformation will work although you're limited now.

Another way around this without any custom code is to create a "banner" page type and simply place the articles and banners in the content tree as you wish and user a Hierarchical Viewer to display them.

0 votesVote for this answer Mark as a Correct answer

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