1

My company website has several physical locations / branches that need to be referenced all throughout the website on basic pages.

I would like to create one central table with one instance of each location so that when details change for that location I can make that one change and it will dynamically update all instances of that location across the site.

I could create a block for each location and reference that block where applicable, but the location content needs to go within the actual body of the pages and not in a block region. Is this possible?

1
  • Realized I didn't answer you question about blocks. I added some info to the original answer below.
    – Dave Bruns
    Commented Feb 19, 2014 at 18:26

2 Answers 2

0

You could try something like the following:

  • Custom content type 'location' with the fields you need for your locations
  • Consider addressfield if these are address locations, or geofield if not
  • if you need mapping, consider leaflet
  • To use/display these locations elsewhere, you could add an entity reference field to other nodes or entities, and populate the field with links to the required location(s).
  • if you need to embed locations (e.g. in the body of a node ) perhaps node embed or advanced entity token (I've not used either one)
  • If you need to add additional view modes, you can use display suite or entity_view_mode

So, the general idea is that you define locations as needed using a custom content type. Then you attach these locations to other nodes/entities using fields or by embedding using a module that uses tokens or another special syntax.

With either approach, each location is stored just once, and the location is rendered on a page using a view mode that makes sense in that particular context.

To address your question about blocks specifically: you could indeed create blocks for company locations. To associate these blocks to pages/nodes, you could either embed the block in a node with something like insert block (https://drupal.org/project/insert_block), or attach the block to a node using block reference (https://drupal.org/project/blockreference).

0

This answer worked perfectly! I was able to use addressField and Node Embed modules to accomplish exactly what I needed. The only issue I had was getting the node embed plugin to work with CKEditor toolbar, but manually adding the node ID token into the page content renders just fine. Thanks for the answers.

1
  • Glad to hear it worked! You should "accept" the answer and possibly up-vote as well (standard practice on Drupal Answers for answers that work). Yes, getting CKEditor (or any wysiwyg) to behave is another issue :)
    – Dave Bruns
    Commented Feb 19, 2014 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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