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 168 karma points
    4 days ago
    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 61 posts 246 karma points
    3 days ago
    Daniel
    1

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

  • Garðar Þorsteinsson 51 posts 328 karma points
    3 days ago
    Garðar Þorsteinsson
    0

    Agree with Daniel,

    Also you could use dictionary items for this purpose.

  • Alex Skrypnyk 4114 posts 14673 karma points mvp
    3 days ago
    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 51 posts 328 karma points
    3 days ago
    Garðar Þorsteinsson
    1

    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 742 posts 1871 karma points
    2 days ago
    Claushingebjerg
    0

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

  • Daniel 61 posts 246 karma points
    2 days ago
    Daniel
    1

    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 12 posts 80 karma points
    2 days ago
    Leonardo Moura
    0

    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