Is there a recommended and consistent way of adding social buttons?

Drupal (CMS): When adding things like buttons and widgets (like one that sends you back to the top of a page) is it best to integrate these into the page template as markup or create node blocks that sit in regions? Is it ever wrong to use the tpl files in this way?

  • Answer:

    Depends on your usage of the button/widget. If the widget is, say, 'login/register', you should go with a region/block (depending on drupal 6/7 and the theme engine). If the widget is content type specific or node specific, include it in the tpl files. Depending on how generic the element is, you may have to go deeper. However, tpl files are meant to provide such themeing power.

Ratul Saha at Quora Visit the source

Was this solution helpful to you?

Other answers

The best way is to build those element in a custom module and assign/display on pages. If you do on a template, and if there are multiple templates on your site, you will need to add those widgets on all the pages.

Bhavin Joshi

Totally dependent on your usage of the button or the widet you are using. It also depends onĀ  the theme engine (Drupal 6/7/8), you shoould go with a region/Block if the widget says login/register. Manager http://www.markupbox.com/

Aaron Singleton

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.