Hero image on certain page (site structure)

Jignesh Patel asked on September 30, 2015 06:04

Hi,

Slowly learning Kentico.

I want to show hero banner (which has custom HTML) on home page and some landing pages but not all pages. I was thinking to make a page type and update transformation as required. So I have created following structure

/site/home
/site/home/herobanner
/site/home/herobanner2
/site/product
/site/services
/site/product/herobanner
/site/contactus
/site/contactus/heroBanner

So in future if I need to personalise Hero banner I can do following as well.

- Site
  - home
        - herobanner (website visited from USA)
        - herobanner2 (website visited from UK)
  - product
  - services
        - herobanner
  - contactus
        - heroBanner

My concerns for using above structures

  • End user can go to the page like /home/hero-banner.aspx even that is not a page
  • Editors have to uncheck properties like “Show in Navigation” etc.
  • Have to render control using Random page web part

Is there any other recommended structure I should use? Can you see any issues doing this way?

Thanks

Regards, Jigs

Correct Answer

Brenden Kehren answered on September 30, 2015 06:12

What you're explaining is what Kentico is used for. A custom page type is by far the best way to go. Yes people COULD navigate to those pages but changes are very slim the will ever because they need to know the exact URL of that "page".

Secondly there should be no need to uncheck the "show in navigation" if you set your navigation webpart up properly it won't be an issue at all because it will already be filtered out.

Thirdly, there is a random document webpart which will do all the work for you if you're looking to randominize how your hero images are showing. Another option is to specify NEWID() in your Order By property, which should get a random document

3 votesVote for this answer Unmark Correct answer

Recent Answers


Jignesh Patel answered on September 30, 2015 06:19 (last edited on September 30, 2015 06:19)

Thank you Brenden. Is there any other recommended way (instead of random page web part) I should use to display this type of HTML?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 30, 2015 06:19 (last edited on September 30, 2015 06:20)

I'd say the random webpart is probably the best. It will handle all the caching and if you don't want it to handle caching then set the cache in the webpart to 0 so it displays a new random image each time the page loads.

I should mention, you could add a hero image field to the Page (menu item) page type as well, this is another option. Then the data is with the page vs. a custom page type. There are many options but it's really your choice.

0 votesVote for this answer Mark as a Correct answer

Jignesh Patel answered on September 30, 2015 06:22

Thanks Brenden.

0 votesVote for this answer Mark as a Correct answer

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