4

By default the titles are showed as links to there node if you choose to display format rendred entity (full).

I want the titles as plain text and not links

5 Answers 5

1

If you have display suite. You will need to do this no in the rendered part, you have to do this in the view mode of the content type that you are rendering for instance. I have installed display suite and that helps me to have more control over the layout

  • profile product --> rendering entity from news product displayed as teaser
  • news product --> In news product in the teaser view mode or full mode in your case, in manage display choose the title and select no link.

You need to have applyed a column layout in display suite to see it.

changing title with display suite

0

You might try looking in the template of whatever node type you are rendering by entity reference. So if your entity reference points to a content type of "type1", edit the tpl.php file that themes the "type1" content type (this will be different based on whatever version of Drupal you are using). My guess is, that template is probably where the title is being displayed as a link. I usually render my entities via more complex php in the template and using node_load(), though.

0

you can create template for your particular content type node--your_content_type_name.tpl.php

1) In this template file you will receive variables for your particular node content like for your title $title

 * Available variables:
 * - $title: the (sanitized) title of the node.


    then you can use strip_tags() function for removing link and print this variable where you want.

2) you can create view for particular content type listing and where you can easily change you title link to plain text when you all fields for listing.

0

Hi create new view for that particular content type,in that view edit content title then you will find Link this field to the original piece of content un check that check box,if you need theme that template file.

0

Just an FYI for Drupal 8 and the comments above,

When an entity relation field displays options via a view the view fields are not used, instead it is the entity label https://www.drupal.org/node/2174633 this is still being worked on, a fix is slated for 8.5 so in this case the only way is to disable the link is with the twig files.

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.