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

  • Try like this <a href="{{ view_node_1 }}">{{ title }}</a> . It will display title with link to content for node/8. – Ajay Reddy May 8 '18 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 – Manmeet Khurana May 8 '18 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 May 8 '18 at 6:04
  • yes i want to add project_name/TiTLE space replaces with dashes in title using content:link to content – Manmeet Khurana May 8 '18 at 6:07
  • is I have to set custom url alias every time when added the content ? – Manmeet Khurana May 8 '18 at 6:08
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.

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.