How can one add fields to site information section?

Maybe explaining the purpose can lead to an other approach. Building a template site for Hotels/B&B's wich needs to feature simple re-usablity. For example the address data, contact data, location etc centralized to make it easy to setup an new instance of the template. Sure I can use something like this, but I don't know I can use special fields like location or address fields. .

'checkbox', '#title' => t('Use my setting'), '#default_value' => variable_get('extended_siteinfo_extra_setting', TRUE), ); } } ?>

Maybe creating a content type site-information and creat one node with the info, is an easier approach but it feels very wrong...


What I do is create a content type for storing this data and use Views to display/output the attached fields as a block.

Views itself natively supports importing and exporting (if I'm not mistaken through Chaos tool suite (Ctools)), and to copy the content type you could use Bundle copy.

This allows me to easily reuse parts of website structures in other projects.

|improve this answer|||||
  • Yeay, it is probably the most pragmatic way to do this.. altough I would generate features from the views. – byenary Jul 8 '15 at 22:01

The easiest solution can be like you said using nodes , creating a content type , storing data and then viewing them in right positions.

You also can add them as features to your theme and then make some facilities to change this data using theme settings , just like how logo is added to theme ,

Using variable_get is not my taste in this situation cause I have an imagination of settings for variable_get function , but it is not wrong .

There always could be more options , even you can have all data in an xml file or a key=>value file (like .info file) and write a custom module to read/modify them

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.