Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Global contact fields

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 161 Views
  • petokavva
    Avatar
    Community Member
    2 Posts

    Global contact fields Link to this post

    Hi all,

    I would like to ask you a very basic question. I wanted to make tab 'contacts' in admin page edit where will be everything. From phone numbers, address, to social links. It works like a charm, even in templates I used <% if $Twitter, etc..
    But then I found that what I put in is tied to one page, based on page ID. But, I would like to have those contacts as global var, so I can set them once (admin frontend update required) and have them available across all pages, includes, etc..
    How to do it properly? Or do I have to make some contact module for it?

    Thank you

  • martimiz
    Avatar
    Forum Moderator
    1078 Posts

    Re: Global contact fields Link to this post

    That is where the SiteConfig class comes in - see the Settings menuitem in the left menubar. Here you can add your sitewide settings. The way to do that is create a DataExtension for the SiteConfig, and access its properties from the template as $SiteConfig.SomeProperty. The Silverstripe docs will tell you more:

    http://doc.silverstripe.org/framework/en/reference/siteconfig

  • petokavva
    Avatar
    Community Member
    2 Posts

    Re: Global contact fields Link to this post

    Hi martimiz,

    can it be that easy? I followed instructions on that link you posted and solved it in five minutes.
    Thank you very much for your help. Now it works across whole page and its nicely wrapped in settings.

    Thanks, have a nice day

    161 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.