Textpattern CMS support forum

You are not logged in. Register | Login | Help

#151 2019-12-21 10:32:39

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 82
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

Inside my macro I have some php. I test it with a simple

<txp:php>
echo ‘hello world’;
</txp:php>

to make sure it is not the php itself.

When I use the macro inside of my <txp:body/> all works fine.
When I try to use it just inside of <txp:article/> it works also but not the php-part.
In my peferences of the textpattern installation I have “allow php” in articels and pages checked.

Any idea why this is happening?

Last edited by demoncleaner (2019-12-21 10:32:50)

Offline

#152 2019-12-21 10:42:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,948
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

demoncleaner wrote #320636:

When I use the macro inside of my <txp:body/> all works fine. When I try to use it just inside of <txp:article/> it works also but not the php-part.

That’s to do with Txp 4.7’s parser disallowing PHP from running on anything secondpass or higher (for security). See this discussion for more info and workarounds. If you can wait a day or two, the 4.8 beta will hopefully be out, where this restriction has been lifted.

And, btw you shouldn’t need this plugin any more. I’m retiring it. Textpattern can do everything it could, far cleaner and faster and safer using special shortcode forms. Check ‘em out and if you need any help migrating to the core solution, just holler on the forum.


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

#153 2019-12-21 11:01:59

demoncleaner
Plugin Author
From: Germany
Registered: 2008-06-29
Posts: 82
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

Thanks Stef,

actually I am still using smd_macro a lot. Did not realize that it can be done better and cleaner without it. I will dig into shortcode forms.

Apart from that I can wait for 4.8.

Thanks again for your fast reply and Merry Christmas!

Last edited by demoncleaner (2019-12-21 11:02:39)

Offline

Board footer

Powered by FluxBB