Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-11-22 21:21:19

rangetb
New Member
Registered: 2010-06-14
Posts: 3

article links to URL not textpattern page

Is it possible to create a new article, but instead of having it link to a content page, it goes directly to a URL like www.test.com?

In my CMS when an article is created, it builds a page that is generated dynamically so I can’t “hard code” the URL in the template area. Hopefully this makes sense
Thanks

Offline

#2 2010-11-22 21:59:42

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: article links to URL not textpattern page

Not sure I understand you correctly. Are you saying that you want to display an article list, where one (or more) of the titles do(es)n’t link to an article on your site but to an external page? Or a list of links to external pages? In that case you can better store them as links than as articles. If it’s about just a single link, you could even hard code it.

Offline

#3 2010-11-22 22:09:01

rangetb
New Member
Registered: 2010-06-14
Posts: 3

Re: article links to URL not textpattern page

This one:

Are you saying that you want to display an article list, where one (or more) of the titles do(es)n’t link to an article on your site but to an external page?

Offline

#4 2010-11-22 23:14:57

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: article links to URL not textpattern page

You can use a custom field to store the URL. Let’s say you name it ‘external_link’. Then in the article form something like this:

<txp:if_custom_field name="external_link">
   <a href="<txp:custom_field name="external_link" />"><txp:title /></a>
<txp:else />
   <txp:permlink><txp:title /></txp:permlink>
</txp:if_custom_field>

Offline

#5 2010-11-23 01:08:23

ax
Plugin Author
From: Germany
Registered: 2009-08-19
Posts: 165

Re: article links to URL not textpattern page

Also you can use the Links tab and make some links point to articles, others point to external links.

Offline

Board footer

Powered by FluxBB