Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-07 12:00:30

cochez
New Member
Registered: 2005-04-27
Posts: 3

make absolute permalinks instead of relative permalinks in textpattern

Hey,

I use textpattern to generate a newsletter. The only problem is that the hyperlinks generated by <txp:recent_articles /> and <txp:permlink> are useless at the mailclients-side, because they are relative.

How do I make absolute permalinks (with <txp:recent articles /> and with <txp:permlink>) instead of relative permalinks with textpattern?

Could it be an option to define the standard root on top of the html-code, and if so, how do you do this?

Last edited by cochez (2007-02-07 12:01:33)

Offline

#2 2007-02-07 12:35:42

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: make absolute permalinks instead of relative permalinks in textpattern

Could it be an option to define the standard root on top of the html-code, and if so, how do you do this?

This is defined in the Site URL in Admin —> Preferences. All URL’s are based off the root you enter here.

Offline

#3 2007-02-07 12:45:17

cochez
New Member
Registered: 2005-04-27
Posts: 3

Re: make absolute permalinks instead of relative permalinks in textpattern

Thanks for the quick answer, but the siteURL was allready filled out from the beginning, so that couldn’t be the problem.

Any other options?

Offline

#4 2007-02-07 15:33:24

Elenita
Member
From: Falls Church, VA
Registered: 2004-05-16
Posts: 407
Website

Re: make absolute permalinks instead of relative permalinks in textpattern

Can you tell us the following:

  • What your current links Textpattern generates look like
  • What you would like the links Textpattern generate to look like
  • What is entered into the Site URL field right now

Thanks.

Offline

#5 2007-02-07 15:42:07

cochez
New Member
Registered: 2005-04-27
Posts: 3

Re: make absolute permalinks instead of relative permalinks in textpattern

Hey thank you for your time, but I solved my problem by writing my own script this way:

<?php
// connect
$con = mysql_connect(“localhost”,“xxxxxxxxx”,“xxxxxxxxx”) or die(‘could not connect:’.mysql_error());
mysql_select_db(“xxxxxxxxx”,$con);

// which category do you want to list
$category = “xxxxxxxx”;

// query
$sql = ‘SELECT `ID`,`Title` FROM `txp_textpattern` WHERE `Category1`=\’‘.$category.’\’ OR `Category2`=\’‘.$category.’\’ ORDER BY `Posted` DESC’;
$result = mysql_query($sql) or die(‘Error, query failed. ‘ . mysql_error());
echo “List<br />”; while ($row = mysql_fetch_array($result)) { echo “<a href=‘http://www.mysite.com/index.php?id=”.$row0.”’>”.$row1.”</a><br />”; }

// close connection
mysql_close($con);
?>

Last edited by cochez (2007-02-07 15:44:03)

Offline

#6 2007-02-08 01:58:58

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: make absolute permalinks instead of relative permalinks in textpattern

Textpattern uses absolute urls. If you’re not getting that, you have either modified something or something is otherwise seriously wrong.

Offline

Board footer

Powered by FluxBB