2

I am making a site for a music festival. I have one content type for attending artists, which includes the following fields of the fields type Link: soundcloud, youtube etc.

I would like to print these fields with an image (small icons) instead of the written link.

How can I do that?

( The path I am looking at for the moment: copy node.tpl.php, rename to node--artist.tpl.php, add some code, put in sites/all/themes/default_theme. )

1
0

It's easier and more practical apply a preproccess hook:

Function YOUR_THEME_proprocces_node__artist(&$vars){

 // $vars contain the fields to be renderable in content attribute

}

I resolved a similar question a few days ago: change links read more and add comment

Inside of array tree $vars['content], you will have to change the title attribute adding the html mark you want.

If you have a problem to find the tree or change the array, print the array with the dpm($vars) in your code and capture an screenshot to publish here.

2
  • Thanks! I am not quite with you though .. Where shall I put the preprocess-function? I am using Corolla as default theme (sub-theme to Adaptive theme).
    – Eke
    May 8 '13 at 12:47
  • IN the template.php file in your sub-theme
    – Rufein
    May 8 '13 at 13:12

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.