Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
968 views
in Technique[技术] by (71.8m points)

apply rel="nofollow" to field in drupal 7

I have content type with name "Product" and there is field name Remote product link and field type is link. I want to set rel="nofollow" for this field. I am new to drupal and I am stuck here. Can anyone please help me on this? Thanks in advance.

question from:https://stackoverflow.com/questions/65560997/apply-rel-nofollow-to-field-in-drupal-7

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can have specific field and node templates for your field / content type.

Checkout on template naming conventions i.e. here:

https://www.drupal.org/docs/7/theming/template-theme-hook-suggestions

So you should find original (core) template, copy it to your theme, but name it by following those conventions (you are overriding core templates that way) and clear drupal cache so drupal will start using it.

You can override just a field template (i.e. field--field-name.tpl.php) , but you can also override whole node template (i.e. node--product.tpl.php) and from it print field by field, the way you like.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...