Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Media shortcode. Requests accepted
colak wrote #324856:
Hi Michael,
I’m not certain as to what unsplash does. Admittedly I did not come across this site before. Re photos in general, I intentionally left image hosting sites out, flickr for example. This is because I think that most hosting providers can cope with images and I see no reason of using an external service.
The idea behind the site, like Pexels, is that lets photographers put up stock photography quality photos and users download them without the expensive licensing that the larger sites require.
And that is an excellent point about being able to handle it natively.
Offline
Re: Media shortcode. Requests accepted
This is finished for now. I am currently including embeds from 22 hosts, as well as a possibility for local video and audio html5 tags.
Furthermore I created soft error warnings, visible to logged in users only. These warnings do not catch errors in the copied and pasted media ids etc, but check if the required or recommended yields have been included.
I guess I pushed this shortcode as much as I could and hope that it will be of some value. It now has 796 unwrapped lines, but it should be easy to edit should anyone want to do so.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Media shortcode. Requests accepted
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
Re: Media shortcode. Requests accepted
Bloke wrote #324948:
It’s Textpattern’s first long shortcode :D
I guess that I found out that the name refers to the way we call them ie <txp::sortcode do something />
and not the code in the form:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Media shortcode. Requests accepted
Thanks Colak! Nicely done!
Offline
Re: Media shortcode. Requests accepted
Thanks Yiannis.
A good job very useful ;)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Media shortcode. Requests accepted
>Edit: Traced the problem.
This has become a little bit of a pet project and I am still adding features and providers. The latest code though, has an issue that I cannot pinpoint. Everything appears to be loading just fine except the datawrapper yield which throws errors further up in the code. The errors, after replacing their html entities, read: SOLVED
Tag error: <txp::media from="yt" url="pl" title="yt pl test" media="PLAC463A2B6B2CEC7F" /> -> Textpattern Warning: Opening tag without corresponding closing tag: <strong><txp:if_yield name="title"></strong>. while parsing form <strong>media</strong> on page <strong>Blog</strong>
Tag error: <txp::media from="yt" url="pl" title="yt pl test" media="PLAC463A2B6B2CEC7F" /> -> Textpattern Warning: Opening tag without corresponding closing tag: <strong><txp:oui_if_cookie name='<txp:variable name="sitename" />_datawrapper'></strong>. while parsing form <strong>media</strong> on page <strong>Blog</strong>
Tag error: <txp::media from="yt" url="pl" title="yt pl test" media="PLAC463A2B6B2CEC7F" /> -> Textpattern Warning: Opening tag without corresponding closing tag: <strong><txp:if_yield name="media"></strong>. while parsing form <strong>media</strong> on page <strong>Blog</strong>
Tag error: <txp::media from="yt" url="pl" title="yt pl test" media="PLAC463A2B6B2CEC7F" /> -> Textpattern Warning: Opening tag without corresponding closing tag: <strong><txp:if_yield name="from" value="dw"></strong>. while parsing form <strong>media</strong> on page <strong>Blog</strong>
After cutting the datawrapper code and pasting it in another form (which I called media2), all my shortcodes, including the media2 one, load without any errors.
I have no idea, but this is indeed a head-scratcher.
Last edited by colak (2020-08-14 17:15:20)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline