Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-02-26 16:36:56

lindabb
Member
Registered: 2023-02-17
Posts: 111

site_url inside article

Hello,
I use <txp:site_url /> to show images, works inside pages and forms, but doesn’t work inside article

<img src=”<txp:site_url />images/image1.jpg”/>

inside article, closing > converted to &gt;

when I check the page source, shows as below:
<img src=“http://localhost/textpattern2/images/image1.jpg”/&gt; <— this closing cases the issue.

any idea ?

Thank you

Offline

#2 2023-02-26 17:55:09

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: site_url inside article

To make sure that your code will not be touched by textile, you can surround it by using ==

==<img src="<txp:site_url />images/image1.jpg"/>==

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2023-02-26 18:07:34

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

Re: site_url inside article

Further to what colak said, if you’re not using any other features of Textile in an article you can elect to turn it off completely by switching the drop-down above the textarea to Leave Text Untouched.

To ‘escape’ something that you wish to display verbatim without Textile misinterpreting it, you can either surround it with double equals as mentioned above, or use notextile. (plus a space) at the start of the line or, in some cases depending on how complex the content you’re escaping is, begin the line with two spaces.

If you do choose to turn off Textile processing completely, you can still process individual blocks of content in the article by surrounding them with a tag and telling it to consider it as Textile via the escape attribute. E.g.:

<txp:evaluate escape="textile">
* I am a Textile list
* Comprising a few bullet points
* Like this
</txp:evaluate>

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 2023-02-26 19:19:02

lindabb
Member
Registered: 2023-02-17
Posts: 111

Re: site_url inside article

Thank you both for reply,
Both didn’t work, treated as text, in that case didn’t show image,
but Bloke’s suggestion worked when I changed article format to “leave text untouched” the image showed up nicely !

again, thank you both.

Offline

Board footer

Powered by FluxBB