Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Article image URLs: how to use forms and breaks?
The new feature that allows direct https:// URLs in the article image field is not quite working, imo.
STR (not on demo site, as it doesn’t allow image URLs for some reason) on a stock 4.9.0-dev installation:
- Create a new article.
- Add two comma-separated image URLs to the Article Image field, e.g.:
- https://cdn.pixabay.com/photo/2014/06/03/19/38/board-361516_1280.jpg
- https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Test.svg/1240px-Test.svg.png
- Save.
- View article.
ER: Image URLs show up one after the other.
AR: Image URLs show up one after the other, with br
between them.
Further, it is not possible to pass such images through a form. In the default
Form, the stock install uses <txp:images form="images" />
but that “images” form is ignored if the article image contains a URL-style link. Confusing.
This means it’s not possible to add overlays or other text or any surrounding markup unless it’s done in the calling environment — in this case, by surrounding the call to <txp:images>
in Form default
with markup. And even then, it’s only markup that can be output around the entire set of images, not per image.
To even attempt to do this effectively and retain the ability to pass regular images to the form as normal, it requires a further test to check (via <txp:if_custom_field name="article_image">...
) to see if the image contains a URL-style link, rather than one from Txp’s internal store, and then do something different (such as set break=""
or call <txp:output_form>
and manually split and go through each image inside that Form).
So, two things:
- We need to somehow fix the rogue ‘br’ break from showing if more than one URL is supplied; and, possibly related:
- Is there any way we can still pass external images through a form or (more easily) detect which type of image has been supplied (URL, versus Txp ID versus Txp internal reference to an image) so that processing can be differentiated in the various cases?
Last edited by Bloke (Today 09:24:44)
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: Article image URLs: how to use forms and breaks?
Bloke wrote #339588:
STR (not on demo site, as it doesn’t allow image URLs for some reason) on a stock 4.9.0-dev installation:
Likely a CSP limitation, leave it with me and I’ll change it.
Edit: demo sites now allow Pixabay CDN images.
Last edited by gaekwad (Today 13:18:46)
Offline
Re: Article image URLs: how to use forms and breaks?
gaekwad wrote #339589:
Likely a CSP limitation… demo sites now allow Pixabay CDN images.
Awesome, thank you so much. Didn’t think to check the console.
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