0

I need to rewrite my view fields like:

<a href="{{ path }}">
 <div class="card-header">
   <h3 class="card-title">
     {{ title }}   
   </h3> 
 </div>
</a>

But if I click on Add field (in my view), nid, or path are not available? I have to construct my <a> link attribute like above markup. But how do I render the URL path to the node?

1 Answer 1

1

But if I click on Add field (in my view), nid, or path are not available?

Did you create a view of Show: Content ? (re-using pic from other answer, look in view settings)

You probably selected something else, hence why those fields are not available.

So you could add a relationship of node content or create a brand new view again and this time make sure you select Show: content.

1
  • In my view I am loading Solr indexed fields. I figured out the solution by Checking Retrieve result data from Solr in the solr server configuration (Advanced tab). After checking this box I am able to use {{ url }} in my view.
    – meez
    Commented Feb 9, 2017 at 20:49

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.