I have a theme using a views tpl file that is making it impossible for a View to link to node content using the node’s aliases' that i’ve set up. For example it is linking to the default node/36 instead of projects/projectname.
the view contains a grid of ‘thumbnail like content’ wherein each image links to it’s corresponding node. the views template file is renderering links as shown below:
<a style=" background-image: url('<?php print $thumbnail;?>'); "
class="w-inline-block portfolio-photo portfolio-1"
href="<?php print drupal_get_path_alias('node/').$row->nid;?>">
It’s hardcoding /node/ as a directory and use the function $row->nid
Is there an alias equivalent to nid? Instead of node/36 it the url should be project/projectname
To rewrite the above code using pseudo code it would be…
<a style=" background-image: url('<?php print $thumbnail;?>');"
class="w-inline-block portfolio-photo portfolio-1"
href="<?php print drupal_get_path_alias(‘projects/‘).$row->alias;?>”>