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
    0

    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 118 posts 458 karma points
    Jan 14, 2018 @ 16:10
    Daniel Chenery
    101

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

  • Garðar Þorsteinsson 63 posts 348 karma points
    Jan 14, 2018 @ 20:30
    Garðar Þorsteinsson
    0

    Agree with Daniel,

    Also you could use dictionary items for this purpose.

  • Alex Skrypnyk 4694 posts 16791 karma points MVP 2x admin
    Jan 14, 2018 @ 20:46
    Alex Skrypnyk
    0

    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 63 posts 348 karma points
    Jan 14, 2018 @ 20:52
    Garðar Þorsteinsson
    2

    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 776 posts 1942 karma points
    Jan 15, 2018 @ 14:10
    Claushingebjerg
    1

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

  • Daniel Chenery 118 posts 458 karma points
    Jan 15, 2018 @ 14:54
    Daniel Chenery
    2

    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
    1

    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:

Draft