Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [howto] Using the new image tags in Txp 4.3.0
And to get back on topic :)
In the demo I neglected to make full use of image_list’s nifty automatic context checking. I used it for article context, but not image category context. I’ve updated the demo to do so; results in cleaner code for the gallery example.
Code is topiary
Offline
#32 2010-09-29 14:44:24
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: [howto] Using the new image tags in Txp 4.3.0
I can’t get it to work with this line in the Javascript
document.getElementById('sooGalleryCaption').childNodes[0].nodeValue = showThis.title;
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
Are you saying the demo site isn’t working correctly for you, or that you’ve tried to test it on your own server and it doesn’t work?
Code is topiary
Offline
#34 2010-09-29 14:55:02
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: [howto] Using the new image tags in Txp 4.3.0
My own server. Firebug says
document.getElementById("sooGalleryCaption").childNodes[0] is undefined
Yet the images do have titles.
Last edited by FireFusion (2010-09-29 14:55:14)
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
Right, but did you add an element for the caption, as in the example?
<p id="sooGalleryCaption"><txp:image_info /></p>
Code is topiary
Offline
#36 2010-09-29 15:07:30
- FireFusion
- Member

- Registered: 2005-05-10
- Posts: 698
Re: [howto] Using the new image tags in Txp 4.3.0
It’s ok. Fixed it. The element was blank on the first image. Thanks :)
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
Dragondz wrote:
Hi Stef may be you can use article_image like this:
sort='FIELD(ID,<txp:custom_field name="article_image" />)'
Undocumented feature. I tested it and confirmed that this outputs the raw value of article_image.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
Any progress on the txp:images offset problem?
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
damienbuckley wrote:
Any progress on the txp:images offset problem?
Just encountered this problem… Maybe this bug fix should go in release?
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
the_ghost wrote:
Maybe this bug fix should go in release?
If you mean that you can’t specify an offset without setting a limit, we should probably fix <txp:linklist /> as well, which functions in exactly the same way (I modelled <txp:images /> on <txp:linklist />). Nobody’s complained about that and it’s been like that since the tag was first written! Either way we should take this discussion off Jeff’s thread.
Last edited by Bloke (2010-11-16 11:46:01)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
Is there anything like txp:if_first_image and txp:if_last_image functionality in conjunction with txp:images?
I did try replicating the corresponding functions for article/category/section with $thisimage and assert_image(); but they did not function as I expected them to. I guess there’s a reason for that.
In the end I achieved what I wanted with a combination of jmd_count and txp:variable but it was a roundabout way of getting there.
TXP Builders – finely-crafted code, design and txp
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
jakob wrote:
Is there anything like
txp:if_first_imageandtxp:if_last_imagefunctionality in conjunction withtxp:images?
No. The same holds for links and file downloads. Only articles have the notion of first and last at the moment.
I did try replicating… with
$thisimageandassert_image();but they did not function as I expected them to.
$thisimage, $thislink and $thisfile don’t have entries for is_first and is_last so the only way to do it is via a plugin or some brief counting PHP. If jmd_count and txp:variable are the most efficient way of doing it then perhaps this should be a TXP tip?
Last edited by Bloke (2010-11-28 10:17:13)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
Thanks, Stef, for shedding light on that.
perhaps this should be a TXP tip?
Well I think this use case was a bit specific as most of the time you can simply place the closing statement after the closing </txp:images> tag.
In my particular case I wanted to wrap every set of three images in a div (e.g. insert close ul + div and open a new div + ul after each third image) but not in the final case (which also happens to be divisible by three). The solution was find the total number of images from the category, then compare the current incrementing image number against that (like using {counter} and {totalimages} with smd_if / smd_gallery in the not-so-old-days).
TXP Builders – finely-crafted code, design and txp
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
j_soo i tried your gallery example and i get this error:
Tag error: <txp:image_list form="gallery_demo_1" break="" /> -> Textpattern Warning: tag does not exist on line 1183
Wonder what I’m doing, i am using the latest version of txp…
-thanks
its a bad hen that wont scratch itself.
photogallery
Offline
Re: [howto] Using the new image tags in Txp 4.3.0
kvnmcwebn wrote:
tag does not exist…
<txp:image_list> was renamed to <txp:images> at the last minute.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline