Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-03-18 10:58:07

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Textile links to use site_url

Not something for Textpattern core I guess, but one thing that would be nice for local and staging would be links that use the site_url tag instead of whatever we enter into an article.

It gets confusing to use f.e: "Get in touch with us":http://domain.com/contact/ instead of "Get in touch with us":<txp:site_url />contact/.

Simple change, but very worthwhile for local development.

Offline

#2 2014-03-18 11:15:29

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

Re: Textile links to use site_url

Doesn’t "Get in touch with us":/contact work for both staging and live, and is shorter to type?

Maybe I’m missing something…


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

#3 2014-03-18 12:55:43

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Textile links to use site_url

Thanks, I was thinking about a method for absolute URL’s instead of relative. Hence the use of site_url. Maybe I’m missing something ;)

Offline

#4 2014-03-18 14:21:34

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Textile links to use site_url

As for the request, unfortunately can not do. That’s not something we can implement. It could technically happen in PHP-Textile, in a way of it letting invalid HTML get through, but it needs to sanitize and encode input its given.

Your best option is either to regenerate the HTML markup from Textile (you can do it in deployment scripts or whatever you are using), or search and replace URL tokens in the database. You can also route your requests to the development server rather than the live one, which means you don’t have to change your site URL.

Offline

#5 2014-03-18 23:34:21

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Textile links to use site_url

Thanks Jukka and Stef – will stick with what we have then or change to relative URL’s. Appreciate the explanation.

Offline

Board footer

Powered by FluxBB