I would like to replace links in a view I have created with icons. The links are dynamic(varying URLS) but will be be within 5 domains, eg: www.example.com/page7 www.example.com/page2 www.example2.com/page9 www.example3.com/page77

I would like to provide an Icon for each of the Domains which is applied to the link, so that clicking on the link takes the user to the URL(in a new window) and the text is hidden. I am aware of CSS image replacement technique but would like to use https://drupal.org/project/custom_formatters to do this. I am also aware of https://drupal.org/project/image_link_formatter .

Using the Custom Links Formatter module would allow me to import/export, save, reuse and share this function.


Just click on the rewrite results option in the view for the field you want the changes then just add the following :

 <a>href ="www.example.com/page7 "><img src="sites/all/...your image 

In a similar way you can add images

  • Thank you Harshal. While this will work I will have to rewrite results each and every time I want to do this. I am hoping to create a set-up so that it does it automatically when certain conditions are met. ( I tried to mark answer useful but do have the rep, sorry) Oct 30 '13 at 10:36
  • @harshal Is there any way to create a url formatter filter so that it can be used in a text format (plain text or filtered html)
    – Umair
    Dec 15 '16 at 7:43

I think this module will help you on that http://customformatters.com/

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.