Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-02-18 13:52:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

[textile] Textile link aliases with tags

This might be a dumb question but I can’t find a post describing this. If I use a link alias in an article I can supply a full HTML link thus:

Visit our "services page":services
...
 [services]http://site.com/sub-dir/services

(the odd spacing in these examples is just to get round any forum textiling)

That’s fine but the site’s sub-dir location is only temporary while in development and I don’t really want to have to go and remove the sub-dir from all links across the site. I suppose .htaccess might help but I’d prefer to define the link as:

Visit our "services page":services
...
 [services]<txp:site_url />services

That renders the inline link correctly, but also writes out the alias and full URL to the linked page. I’ve currently worked around it by wrapping the whole link alias in <txp:hide> tags but just wondered if I was being a pillock and there was another way to use TXP tags within textile links.

Incidentally:

Visit our "services page": <txp:site_url />services

also just renders the raw link to the page :-(

fwiw, I’m using TXP v4.0.6.

Probably something simple I’ve overlooked. Thanks in advance for any pointers.

[EDIT: Bugger, this should be in the Textile section. Moderator, if you would please… :-) ]

[EDIT2: some wrong info in the post. The correct info

Last edited by Bloke (2008-02-19 14:01:20)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2008-02-18 17:24:43

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

Re: [textile] Textile link aliases with tags

Bloke wrote:

[EDIT: Bugger, this should be in the Textile section. Moderator, if you would please… :-) ]

Your wish is my command :)

Stef, I don’t have an answer to your question, but if you want to show code with blank lines just use bc.. and start the first paragraph after the code with p. (to be honest I don’t know the difference between bc. and pre. so if you were trying to do something else just forget this).

Last edited by els (2008-02-18 17:25:50)

Offline

#3 2008-02-18 17:35:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: [textile] Textile link aliases with tags

Thanks Els :-)

For the formatting thing, I was trying to put the [services] link in the forum but it kept converting it to an actual link alias for me and removing it from the page. I tried notextile (==) and various other tricks but no joy. So I just put a space in front of it. All hail the power of the space character!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2008-02-19 13:59:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: [textile] Textile link aliases with tags

OK, I was wrong.

Link aliases are always ignored when using <txp:site_url />. I just hadn’t noticed because the name I chose for my link alias was the same name as one of my sections, thus I thought it was working :-|

So ignore the “why does it work one way and not the other” question. I would, however, still like to know if anyone has any ideas (even a ham-fisted work-around will do right now) that allow me to use TXP tags inside Textile links.

The long way round is to hand-code the anchors I suppose and use <txp:site_url />services/blah as the href…

Last edited by Bloke (2008-02-19 14:05:09)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2008-02-19 14:06:58

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [textile] Textile link aliases with tags

Hi Bloke.
Could you try this and see if it works?

Visit our "services page":services
...
 [services]/services

Visit our services page

(it seems to work here in the forum)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2008-02-19 14:15:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: [textile] Textile link aliases with tags

maniqui

Yes, it does work fine, thanks… for sites that aren’t in a sub-dir.

[services]/services renders http://site.com/services as expected.

But my Admin -> Prefs -> Site URL is set to site.com/sub-dir so what I was expecting was:

[services]/services to render http://site.com/sub-dir/services

When it didn’t do that I tried to insert <txp:site_url /> into the link alias without success. Maybe my install is screwy? I’ve tried a trailing slash on the Site URL prefs setting, to no avail.

Last edited by Bloke (2008-02-19 14:16:21)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2008-02-19 14:23:22

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [textile] Textile link aliases with tags

So, after finishing the site, you would move it from sub-dir to site root?

In that case, can you convert your sub-dir on a subdomain? like http://sub-dir.domain.com
This way, you can then use the method I suggested in my above post.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#8 2008-02-19 14:26:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: [textile] Textile link aliases with tags

maniqui wrote:

So, after finishing the site, you would move it from sub-dir to site root?

That’s the plan, yes. It’s an update I’m keeping behind the scenes for now.

In that case, can you convert your sub-dir on a subdomain? like http://sub-dir.domain.com

I wish! The hosting package we have here only allows 2 subdomains and we’re using them both :-(

Perhaps I’m going about this all the wrong way…

Last edited by Bloke (2008-02-19 14:27:10)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB