Blog links point to /blog rather than /node/nid please help

mattyb - May 1, 2007 - 10:37

Hi everyone

I've created my first site with drupal, and was amazed how good this software is.

I opted for version 4.7 just because some of the modules such as the carbon footprint weren't avaliable for version 5.x.

The sites gone live, but for the life of me don't know how I've managed to shoehorn this bug.

On these two pages
http://www.biggreenswitch.co.uk/blog and http://www.biggreenswitch.co.uk/latest_news

The h2.title links "Toxic transport builds as cars are dumped" points to the current page url "http://www.biggreenswitch.co.uk/latest_news" and not the page it needs to, which is "http://www.biggreenswitch.co.uk/node/390"

This page is the just blog page.

The second page is using a view, to display the news, and the same thing is happening here too.

Can anyone advise me where I need to look in the code to rectify this problem.

I really don't know where to start looking.

Thanks in advance.

I hope thats enough info to be starting with, if not I'll post on request.

Matt Burke

Further Information

mattyb - May 1, 2007 - 10:57

The items displayed on the latest news page are from a view, that uses the teaser type for it's display type.

I'm also using the "content template" module to style the news items.

Sorted, there was an issue in my node template

mattyb - May 1, 2007 - 11:49

<h2 class="title">
<?php if ($page == 0): ?>
    <a href="<?php print $node_url ;?>" title="<?php print $title ?>"><?php print $title; ?></a>
<?php else : ?> <?php print $title; ?> <?php endif; ?></h2>

In the href attribute, I needed to swap $node_url with print "/node/". $nid ;

I just need to work out now how the link can link to an alias if it has one.

 
 

Drupal is a registered trademark of Dries Buytaert.