Custom Editable Footer

Marco Blasco asked on December 15, 2022 10:03

Hello

I would like to create a Footer Component which is going to be displayed on every Page. For that I created a FooterWidget (ViewComponent). The footer should be editable from a centralized place.

After reading the Documentation I came up with following solution:

is this a viable approach or this is there a better approach?

Thanks.

Cheers Marco

Correct Answer

Not Applicable answered on December 15, 2022 10:54

You can invoke your footer ViewComponent in the _Layout, create a footer page type with the customization you want and have a footer page in the content tree based on that type.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Marco Blasco answered on December 15, 2022 12:02

that would be the alternative solution but it feels a bit dirty....since you are creating a new page type which is going to be used exactly once....So you wouldn't recommend creating a new data type or why suggest that solution and not create a new data type?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 15, 2022 15:59

If you want the content to be editable, then create a single page type like you would for a home page. Add it to the content tree and as Marcel mentioned invoke the footer ViewComponent in the _Layout and you're set. It's not dirty, it's structured content and organization. Beats hard coding it...

2 votesVote for this answer Mark as a Correct answer

Marco Blasco answered on December 15, 2022 16:06

Gotcha. Implemented it that way now.

One last question in this context. Is it somehow possible to limit a PageType to exactly one occurrence in the content tree?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on December 15, 2022 16:26

That would be the responsibility of a global event handler in the CMS solution. You could use Page Type Scopes and force it so it is only allowed in one area of the site. Then in your ViewComponent, set the order of what you retrieve by the content tree (NodeLevel, NodeOrder) and select the TOP(1) so it will only get 1 for you to display. I'd recommend against the global event handler.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on December 19, 2022 16:56

Only thing i'll add, is if you want to use WIDGETS on the footer, then you'll want to use the Partial Widget Page system. If you just want some editable content and you can do it in the Content tab (structured content), go with what Marcel/BK said.

0 votesVote for this answer Mark as a Correct answer

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