Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2020-07-26 13:26:04

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

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

#62 2020-07-28 15:49:14

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

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.

Enjoy: github.com/colak/txp-media-shortcode


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

Offline

#63 2020-07-28 16:28:23

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

Re: Media shortcode. Requests accepted

colak wrote #324942:

It now has 796 unwrapped lines

It’s Textpattern’s first long shortcode :D


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

#64 2020-07-28 17:23:03

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

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

#65 2020-07-28 19:19:45

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Media shortcode. Requests accepted

Thanks Colak! Nicely done!

Offline

#66 2020-07-29 02:41:02

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,626
GitHub Twitter

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

#67 2020-08-14 15:49:35

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

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

Board footer

Powered by FluxBB