1

I built a Drupal website with a custom theme, but in the last stand I need to add a specific code after any post/article published on the site. For example:

article 1

code

article 2

the same code...

The pinpoint is that I don't know how to take a reference of a single post/article to include it in a buckle to add this code.

2
  • How do you insert "article 1" ? Do you use a node display ? In this case you should modify the node template in your theme. Commented Apr 23, 2015 at 16:29
  • I need insert the article 1 trough the add content menu (admin menu). But when it show in the "content" region need add a specific code in any article. I don't understand how y can reference all articles in the code (a hook?) of the region for implement the specific code.
    – Ramos
    Commented Apr 23, 2015 at 16:41

1 Answer 1

0

The easiest way is to create a block and add your code to it if it's html or javascript code. Then for Show block on specific pages select only on the listed pages and add articles/* This will affect all the pages that have articles in their url.

If it's php, you will need to create a custom page tpl file.

go to drupal/sites/all/themes/mythemename/templates and add page--articles.tpl.php This will affect all the pages that have articles in their url.

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.