Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
txp:site_url in a hyperlink
Hi.
I’m scratching my head on something which is likely very simple and will no doubt make me feel rather stupid when I know the answer.
I want to link to a given page on a site, in this case a section called contact
. I want to link it from an article, and I have this as my article body:
<a href=”<txp:site_url />contact”>Contact form</a>
On a fresh install of 4.4.1 in my development environment, this outputs…well, nothing.
I have had a number of very late nights over the past week or so, and I will admit that 1015am on a Monday is early for me, but I’d appreciate a pointer on this if anyone has ideas. I’d be even more grateful if this saves me from hulksmashing my Dell screen.
Thank you in advance.
Last edited by gaekwad (2012-07-16 09:28:54)
Offline
#2 2012-07-16 11:06:32
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,304
Re: txp:site_url in a hyperlink
Try
==<a href="<txp:site_url />contact">Contact form</a>==
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: txp:site_url in a hyperlink
Gah! Of course – huge thanks, Uli.
Offline
Re: txp:site_url in a hyperlink
Uli,
What does the double equal marks do? I’ve never seen that before. Is that Textile for something?
Wouldn’t just doing this work, or am I missing something? "Contact":/contact
Last edited by Destry (2012-07-17 16:27:34)
Offline
Re: txp:site_url in a hyperlink
Destry wrote:
What does the double equal marks do?
My understanding is that ==
escapes Textile formatting.
Offline
Re: txp:site_url in a hyperlink
Ah, thanks. I knew there was something for escaping it, but never really used it before so didn’t know offhand.
Offline
#7 2012-07-18 00:49:20
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,304
Re: txp:site_url in a hyperlink
Destry wrote:
What does the double equal marks do?
Yup, like gaeqwad said. It’s effective, typed quicker than notextile.
, not as easy overlooked and deleted as a blank at the beginning of the line and, not least, it looks like a typographical barrier: don’t touch!
Last edited by uli (2012-07-18 00:52:34)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: txp:site_url in a hyperlink
And therefore on this site (in progress) this tag (1) won’t work in an article:
<txp:adi_link url="http://nl.linkedin.com/in/jochemvos/" ext_link="1" image="1" title="Naar de LinkedIn pagina van Mister Dutch"><img src="http://www.misterdutch.nl/new/design/linkedin-icon.png" class="socialmedia-icon" /></txp:adi_link> <txp:adi_link url="http://facebook.com/vos.joop" ext_link="1" image="1" title="Naar de Facebook pagina van Mister Dutch"><img src="<txp:site_url />design/facebook-icon.png" class="socialmedia-icon" /></txp:adi_link>
this tag (2) does:
==<txp:adi_link url="http://nl.linkedin.com/in/jochemvos/" ext_link="1" image="1" title="Naar de LinkedIn pagina van Mister Dutch"><img src="http://www.misterdutch.nl/new/design/linkedin-icon.png" class="socialmedia-icon" /></txp:adi_link> <txp:adi_link url="http://facebook.com/vos.joop" ext_link="1" image="1" title="Naar de Facebook pagina van Mister Dutch"><img src="<txp:site_url />design/facebook-icon.png" class="socialmedia-icon" /></txp:adi_link>==
and with (1) into a module (a tag):
<txp:output_form form="socialmedia" />
it works too … !?
Why doesn’t <txp:site_url />
work in the first place?
Last edited by RedFox (2014-03-14 09:28:32)
Offline
#9 2014-03-14 11:49:09
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,304
Re: txp:site_url in a hyperlink
RedFox wrote #279739:
Why doesn’t
<txp:site_url />
work in the first place?
It’s not the TXP tag itself that gets sheltered by escaping it (Added: <txp:site_url />
by itself works in an article), it’s apostrophes/angle brackets. Textile turns straight quotes into curly ones, angle brackets into character entities, and the browsers depend on correct markup.
Why Textile doesn’t change apostrophes in an output_form
tag, though, still needs an answer ;)
Edited to add annotation.
Last edited by uli (2014-03-14 11:59:21)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: txp:site_url in a hyperlink
uli wrote #279741:
Why Textile doesn’t change apostrophes in an
output_form
tag, though, still needs an answer ;)
rah_replace as a workaround?
Offline
Pages: 1