2

In Block view I want to set the link of content with the title name How to Rewrite Results using the Content:Link to Content? Example showing node/8 to john-bartlett(content title name) By using this {{ view_node_1 }} i am getting the node/8 path but i want the title name john-bartlett. enter image description here Please provide any solution regarding this

enter image description here

6
  • Try like this <a href="{{ view_node_1 }}">{{ title }}</a> . It will display title with link to content for node/8.
    – Ajay Reddy
    Commented May 8, 2018 at 5:59
  • @ajay its giving me the path of node like project_name/node/8. Its working fine but i want to know how to change with title name Please provide solution for this . I am trying for long time Commented May 8, 2018 at 6:02
  • Do you want project_name/TITLE of node to redirected to node page? If yes have you added alias for that?
    – Ajay Reddy
    Commented May 8, 2018 at 6:04
  • yes i want to add project_name/TiTLE space replaces with dashes in title using content:link to content Commented May 8, 2018 at 6:07
  • is I have to set custom url alias every time when added the content ? Commented May 8, 2018 at 6:08

1 Answer 1

2

Download Pathauto module. After installing go to http://YOURSITE/admin/config/search/path/patterns and click add patterns like below.

enter image description here

After adding pattern go to http://YOURSITE/admin/config/search/path/update_bulk and select content and check "Regenerate URL aliases for all paths" and click update. After this, ALL your node path alias should be generated with the title of that nodes.

Then in rewrite result's add this line:

<a href="{{ view_node_1 }}">{{ title }}</a>

All your links and tags will be on your node titles.

6

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.