Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#141 2018-02-28 14:06:36
- Bloke
- Developer
- From: Leeds, UK
- Registered: 2006-01-29
- Posts: 9,989
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
Destry wrote #309526:
I must be overlooking a typo or something?
<txp:smd_if field="{caption}" operator="eq" value="SMD_NONE">
With the curly braces?
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
#142 2018-02-28 14:13:58
- Destry
- Member
- From: Haut-Rhin
- Registered: 2004-08-04
- Posts: 4,662
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
:) Merci !
Offline
#143 2018-06-03 09:50:13
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,460
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
I am trying to create an eu compliant way of loading our videos from vimeo. I thought that the easiest way would be to create a macro but it does not work. This is what I have in the definition field.
<txp:oui_cookie name="accept_vimeo_cookies" values="yes" />
<txp:oui_if_cookie name="accept_vimeo_cookies">
<div class="embed-container" id="vimeo2">
<txp:linklist category="{cat}" limit="100" sort="id asc" form="" wraptag="div" class="slider">
<div class="slide">
<iframe src="https://player.vimeo.com/video/<txp:link_description escape="" />?title=0&byline=0&portrait=0" allowfullscreen></iframe>
</div>
</txp:linklist>
</div>
<txp:else />
<div id="vimeoeucookies" class="noprint">
<p class="centre">These videos, presenting {presenting} are hosted by Vimeo on
<txp:linklist category="{cat}" limit="100" sort="id asc" form="" wraptag="" break=", ">
<a rel="external" href="https://vimeo.com/<txp:link_description escape="" />">vimeo.com/<txp:link_description escape="" /></a>
</txp:linklist>.
</div>
</txp:oui_if_cookie>
The above only returns
These videos, presenting talks by are hosted by Vimeo on .
Indicating that the {presenting}
attribute is working but the linklist is not parsed.
The macro I use is <txp:euvids cat="link_category_name" presenting="something here" />
.
and here is the screeshot
Any help or advice would be greatly appreciated
Edit: SOLVED
Last edited by colak (2018-06-03 15:07:40)
Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#144 2018-06-04 11:42:56
- Destry
- Member
- From: Haut-Rhin
- Registered: 2004-08-04
- Posts: 4,662
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
FYI, I think anything you could have done with smd_macro can now be done natively with tags.
Others will know better than I about limits, if any.
But if first para above is true, then the prudent way forward is to build native shortcodes instead of using the plugin, as the plugin may become obsolete.
Offline
#145 2018-06-04 13:08:56
- Bloke
- Developer
- From: Leeds, UK
- Registered: 2006-01-29
- Posts: 9,989
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
Yes, if you’re using 4.7.0 and can use a native shortcode, now would be a good time to migrate it. You can do everything in a shortcode you can do in a smd_macro. I will probably deprecate this plugin at some point.
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
#146 2018-06-04 14:44:43
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,460
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
Bloke & Destry wrote
use native shortcode
Hmmm. I see the examples are making heavy use of the yield
tag. Although I read many explanations about it in this forum, i did not really understand it yet. I will experiment though as I always prefer using native tags.
Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#147 2018-06-05 16:53:35
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,460
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
Just thought I’ll stop in to say that I have replaced all the smd_macro
s with native shortcode and it works wonderfully!!! It took less than half a day to write the shortcodes and search and replace all instances I had in the articles. This feature is an amazing leap forward for txp which deserved a jump to version 5.0!!! Way to go guys!!!!
Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#148 2018-06-05 22:56:12
- phiw13
- Plugin Author
- From: Japan
- Registered: 2004-02-27
- Posts: 2,231
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
Yes, native shortcode is amazingly magic. Once you ”get” <txp:yield /
the sky is the limit.
Where is that emoji for a solar powered submarine when you need it ?
Offline
#149 2018-06-06 08:39:47
- Bloke
- Developer
- From: Leeds, UK
- Registered: 2006-01-29
- Posts: 9,989
- Website
Re: smd_macro: Create custom virtual Txp tags that do stuff
colak wrote #312354:
This feature is an amazing leap forward for txp
Another satisfied customer :) I love it too.
Thank Oleg, it was his idea. And Jukka for making rah_beacon in the first place, on which this feature is based.
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
#150 2018-06-06 09:01:00
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,066
- Website
Offline