Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Steven Applegate 18 posts 178 karma points
    Jan 14, 2018 @ 02:50
    Steven Applegate

    How should I store global content that's displayed in header/footer?

    Kind of a simple thing, a site I'm working on wants to have their address and a quote in their footer.

    They'd like this to be manageable through Umbraco, as they want to change the quote pretty often, or the address if they change locations or something.

    It doesn't need to be anything more than a Rich Text Editor. But how can I do that? The Footer isn't a document type, it's just part of the Master template.

  • Daniel Chenery 119 posts 462 karma points
    Jan 14, 2018 @ 16:10
    Daniel Chenery

    I would usually put these on my root node (usually a document type of "Home), under their own tab

  • Garðar Þorsteinsson 92 posts 463 karma points
    Jan 14, 2018 @ 20:30
    Garðar Þorsteinsson

    Agree with Daniel,

    Also you could use dictionary items for this purpose.

  • Alex Skrypnyk 5273 posts 19288 karma points MVP 3x admin c-trib
    Jan 14, 2018 @ 20:46
    Alex Skrypnyk

    You can't save RTE values in dictionary items, so the solution is to save site data in the root node or some other node.

  • Garðar Þorsteinsson 92 posts 463 karma points
    Jan 14, 2018 @ 20:52
    Garðar Þorsteinsson

    Yes definitely recommend storing it on the root node, its the most flexible solution.

    Using the Dictionary will only work with Textstring and does not scale well.

  • Claushingebjerg 829 posts 2143 karma points
    Jan 15, 2018 @ 14:10

    +1 on the root node thing, and then render the info recursively where it's supposed to go.

  • Daniel Chenery 119 posts 462 karma points
    Jan 15, 2018 @ 14:54
    Daniel Chenery

    Doesn't even need to be recursive if it's just on the master template ;)

    var site = Model.Content.Site() as Home; I'm a sucker for Models Builder though...

  • Leonardo Moura 21 posts 90 karma points
    Jan 15, 2018 @ 15:35
    Leonardo Moura

    Dear Steven,

    I have to agree with Daniel.

    Put everything that you will need constantly on your theme in the header or footer.

    Don't forget to use a recursive resource, for example:

    @Umbraco.Field("footerContents", recursive: true)
Please Sign in or register to post replies

Write your reply to: