Relational links in blocks

stuckagain - December 23, 2008 - 23:29

Using vategories and blocks, I have developed a Wikipedia like system for boiler plate messages, e.g. "this node needs editing", or "this node would benefit from an image", etc. In each block I include some text, CSS class for formatting and a link to the category concerned, with the idea that if you click on this you can see all other nodes that need editing or images etc. However, I am finding that sometimes the links don't work - somehow they aren't fully relational, for example if the node has the prefix "images/" which some have thanks to pathauto.

<table class="BlockContentTableNoPrint">
  <tbody>
    <tr>
      <td class="BlockContentStripe"></td>
      <td class="BlockContentIconImportantOrange"></td>
      <td>One or more hyperlinks on this page are in need of repair.
<a href="category/website_development/fix_links">All articles containing broken hyperlinks&nbsp;&raquo;</a>.</td>
    </tr>
  </tbody>
</table>

I have also tried using ...

<table class="BlockContentTableNoPrint">
  <tbody>
    <tr>
      <td class="BlockContentStripe"></td>
      <td class="BlockContentIconImportantOrange"></td>
      <td>One or more hyperlinks on this page are in need of repair.
<a href="../../category/website_development/fix_links">All articles containing broken hyperlinks&nbsp;&raquo;</a>.</td>
    </tr>
  </tbody>
</table>

I don't really want to use a non relational URL such as "http://mywebsite.com/category/website_development/fix_links", as currrently the site is on a local test server, and I want the links to work on the test server, and also when I upload to the webserver.

Any suggestions please?

I solved my own problem.

stuckagain - December 27, 2008 - 23:23

I solved my own problem. There are three modules that seem to offer a solution: Pathfilter, Pathologic and URL replacement filter.

Having read a little about the three, I opted for URL replacement filter.

Having installed it and enabled it, I simply used the code...

<table class="BlockContentTableNoPrint">
  <tbody>
    <tr>
      <td class="BlockContentStripe"></td>
      <td class="BlockContentIconImportantOrange"></td>
      <td>One or more hyperlinks on this page are in need of repair.
<a href="http://localhost/drupal/category/website_development/fix_links">All articles containing broken hyperlinks&nbsp;&raquo;</a>.</td>
    </tr>
  </tbody>
</table>

... and now the links in my blocks seem to work consistently throughout my site.

 
 

Drupal is a registered trademark of Dries Buytaert.