You are not logged in.
What I mean by this is:-
Say you have a list of titles in a category, for example CSS-Resources
Ok I want “100+ Resources for Web Developers” to go directly to blog-well
because it is a link to an off site URL
but am happy for “CSS and IE” to go to http://webdevelopmentnotes.com/Web_Development/91/css-and-ie.
How do I do this?
Last edited by SebastianS (2008-04-09 10:18:12)
Offline
You could for instance establish a per-address-redirect via a line in .htaccess:
Redirect /Web_Development/96/100-resources-for-web-developers http://blog-well.com/2008/03/04/100-resources-for-web-developers/
This would be feasible with a plugin, too. I’m not quite sure if one exists, though.
As a third possibility, add these lines to your article’s body:
<txp:if_individual_article>
<notextile>
<txp:php>
header('Location: http://blog-well.com/2008/03/04/100-resources-for-web-developers/');
</txp:php>
</notextile>
</txp:if_individual_article>
Last edited by wet (2008-04-09 11:56:59)
Recent: wet_haystack ׀ Popular: wet_slimpattern ׀ Handy: wet_quicklink
Offline
Thank you for your reply.
I know nothing about .htaccess and just had a look at it and wouldn’t know where to insert the code.
A plugin would be great if it existed.
txp:if_individual_article>
<notextile>
<txp:php>
header('Location: http://blog-well.com/2008/03/04/100-resources-for-web-developers/');
</txp:php>
</notextile>
</txp:if_individual_article>
has it’s merits. I added it to the ‘web development’ page template and everything on the css resources category page became linked to http://blog-well.com/2008/03/04/100-resources-for-web-developers.
Is there some magic form I could use that lI could link specific article id’s to it.
Something like <txp:article id=”#” form=“siteurl” /> the “siteurl’ linking directly to another web address.
So theoretically I just need the code for the form if it exists.
Last edited by SebastianS (2008-04-09 12:42:46)
Offline
SebastianS wrote:
…I added it to the ‘web development’ page template
So, why didn’t you just add the sequence to the specific article’s body?
Recent: wet_haystack ׀ Popular: wet_slimpattern ׀ Handy: wet_quicklink
Offline
Robert said:- “so, why didn’t you just add the sequence to the specific article’s body?”
Well I didn’t realise one could do that, I also didn’t also realise what an articles body is, I know basic terminology.
Thank you very much for helping me with that. It worked.
So simple when you know how. Thank you again, I spent ages trying unsuceesfully to work that out.
Offline
@wet: Robert, I tried your ‘body’ solution in TXP 4.0.6 to redirect from an old article to an update on the same site. It doesn’t work as expected. No redirect is happening.
Without the <notextile> tag I also got a syntax error. Funny, I thought the space at the beginning of the line would be enough?
What could be wrong in my case?
Edit: Well, reading some documentation about php header location tells me that the ‘header’ request/output must be the very 1st output from a page. Using it in the article body literally after already hundreds of outputs were sent seems to be not working.
Last edited by merz1 (2008-04-12 12:39:53)
Offline
Maybe I don’t understand what you’re trying to accomplish, but why not create a custom field called “article_url” and when an article is from an external site, enter the url there. Then in your article form create a conditional that says, “if there is a value in the custom field ‘article_url’ output the title this way (ie with the title linked to the url in that custom field), if not, output the title another way (ie with a normal, site-internal permalink)?
Offline
nabrown78 wrote:
Maybe I don’t understand what you’re trying to accomplish, but why not create a custom field called “article_url” and when an article is from an external site, enter the url there. Then in your article form create a conditional that says, “if there is a value in the custom field ‘article_url’ output the title this way (ie with the title linked to the url in that custom field), if not, output the title another way (ie with a normal, site-internal permalink)?
Yep, good point Nora. In this case, in example:
<a href="<txp:if_custom_field name="URL"><txp:custom_field name="URL" /><txp:else /><txp:permlink /></txp:if_custom_field>"><txp:title /></a>
Last edited by Gocom (2008-04-11 03:26:00)
Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />
Offline
Using the code @wet: Robert gave:-
txp:if_individual_article>
<notextile>
<txp:php>
header('Location: http://forum.textpattern.com/viewtopic.php?id=26843');
</txp:php>
</notextile>
</txp:if_individual_article>
I am able to link directly out of my site clicking the title of an article To link write title directly to offsite URL without opening a secondary page on my site
Reading Nora’s post and Jukka’s post it occured to me it should be possible to make a custom field, replacing the forum URl “http://forum.textpattern.com/viewtopic.php?id=26843” in the above code Robert suggested.
Is that possible?
How? What is the code would needed to replace the individual URL to a custom field/conditional tag say called “article_url”.
Last edited by SebastianS (2008-04-11 11:23:35)
Offline
SebastianS wrote:
How? What is the code would needed to replace the individual URL to a custom field/conditional tag say called “article_url”.
Ya k’nw Sebastian, it’s quit’ eaz’. First example:
<a href="<txp:if_custom_field name="article_url"><txp:custom_field name="article_url" /><txp:else /><txp:permlink /></txp:if_custom_field>"><txp:title /></a>
Or if ya real’ need th’z redirectin’ headers, then:
<txp:if_individual_article>
<txp:if_custom_field name="article_url">
<txp:php>
header('Location: '.custom_field(array(name => 'article_url')));
</txp:php>
</txp:if_custom_field>
</txp:if_individual_article>
Th’z both codes go to ur article form.
Last edited by Gocom (2008-04-11 13:03:13)
Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />
Offline