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 82 posts 337 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 56 posts 337 karma points
    Jan 14, 2018 @ 20:30
    Garðar Þorsteinsson

    Agree with Daniel,

    Also you could use dictionary items for this purpose.

  • Alex Skrypnyk 4418 posts 15850 karma points MVP admin
    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 56 posts 337 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 758 posts 1913 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 82 posts 337 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: