Dear everyone,

I have a title field in Views on which "link to content" is enabled, but now the title style is taking the default theme style for all links. I did append a div tag on the .tpl file but that didn't work. When I check the link in inspector it shows like this:

<div id="custom-id">
<a href="/node/16">Title</a>
</div>

Obviously I have to insert an ID in that href tag, but how. I've tried different things but Views does not have an option ffor adding id tag there. Any idea anyone ? Thanks in advance.

Comments

pixelsweatshop’s picture

You can modify the tpl file or you can just go to Rewrite results in your field settings, enable Rewrite the output of this field and add your html around the field token.

Amjad_dokhan’s picture

Thanks nicoz. I followed your advice then I went on learning how to rewrite fields. I rewrote the title and the link and it works very nicely. Thanks alot

KermitGMan’s picture

Amjad or Nicoz, can you explain how you referenced the content ID in your hyperlink?  I am trying to reference content (node) id in a view, in order to construct a hyperlink, and coming up blank.