Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-03-31 22:13:01

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

[textile] image caption with textile

hello forum,

is there a way to output image captions using textile?

thanks, christoph

Offline

#2 2012-03-31 22:42:34

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [textile] image caption with textile

Offline

#3 2012-04-01 05:39:55

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

Re: [textile] image caption with textile

I don’t think that textile can parse captions but image_info does.


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

Offline

#4 2012-04-01 10:03:44

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [textile] image caption with textile

You’ll be interested in the next Extensional(ism) article in TXP — Issue 2. That’s all we can tell you right now. Work-in-progress. You’re going to love it.

Offline

#5 2012-04-01 20:16:57

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: [textile] image caption with textile

hi all,

thanks for your replies. not sure, if upm_textile can help but will give it a try. what i need is an as easy as possible solution for my clients which i don’t want to deal with txp tags – they have enough to do learning textile (would love to have some feedback: what’s your client’s feedback on textile? do they accept it or do they want wysiwig editors?).

i’m very curious to read txp mag’s issue 2 and what it has to tell me about this topic.

Offline

#6 2012-04-01 22:09:57

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,725
Website

Re: [textile] image caption with textile

I think upm_textile as suggested above – or smd_wrap – can do that for you. Just ask your client’s to use textile in the caption as they would in an article field.

In your template, wrap the image_info tag with the corresponding tag, e.g.

<txp:upm_textile><txp:image_info type="caption" /></txp:upm_textile>

or

<txp:smd_wrap transform="textile"><txp:image_info type="caption" /></txp:smd_wrap>

Your clients don’t need to fuss with the txp:... tags at all if you put them in your page or form templates.

The only thing to consider is that these fields are textiled on the fly and that that can place a load on the server if doing a lot of it. Captions I suspect are short, so unless your page consists of 100s of images at once, the additional server load is negligible. And if that really is a problem you could also use caching.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2012-04-02 08:08:32

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: [textile] image caption with textile

hi jakob,

my apologies, i should have been more clear with my question. i was looking for a way to insert images together with their caption in an article on the write tab (it’s a blog post with several images). like this

"(linkclass)!/images/22t(Das ist der Alternativtext)!":/images/22.jpg

from my experience, only one image per article often isn’t enough.

best, christoph

Offline

#8 2012-04-02 08:25:02

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

Re: [textile] image caption with textile

totoff wrote:

i was looking for a way to insert images together with their caption in an article on the write tab

As far as I know you can’t add captions with Textile. But you can put a comma-separated list of image IDs in the Article Image field and render them as a gallery using the images tag.

Unless you’re going to add them in your template, that implies people writing markup in your articles which can be difficult to explain. So what I’ve done very successfully in the past is write an smd_macro to do it. Then clients just need to enter <txp:gallery /> (or whatever) and it puts the correct code in, complete with captions. And of course you can allow them to customise the tag if you wish with attributes.

Hope that helps.

Last edited by Bloke (2012-04-02 08:25:27)


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

#9 2012-04-02 11:22:37

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: [textile] image caption with textile

hi stef,

actually i already had a look at smd_macro as an option but had no time to investigate further. another alternative could be this jquery plugin. i’ll try out and report back.

many thanks for your kind support.

Offline

#10 2012-04-02 12:49:56

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] image caption with textile

jakob wrote:

upm_textile as suggested above – or smd_wrap or

Can rah_function’s current development version join the party too. As it now has class method support, it can do Textile too.

<txp:rah_function call="Textile->TextileThis">h1. Hello World</txp:rah_function>

Unfortunately it doesn’t (yet?) autoload files, but that would work if the Textile class (classTextile.php) were loaded on the page.

Offline

#11 2012-04-03 10:06:15

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: [textile] image caption with textile

Hi Christoph,

i was looking for a way to insert images together with their caption in an article on the write tab (it’s a blog post with several images).

Maybe you are looking for yab_image

Here with some explanations and examples.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#12 2012-04-07 19:57:33

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: [textile] image caption with textile

hi forum,

thanks to everybody who replied to this post. for the moment i decided to go with the jquery plugin i mentioned earlier. it works fine with textile:

"(fancybox)!(caption)/images/22t(my caption)!":/images/22.jpg

@trenc: thanks, yab_image is great and i tried it before i posted to the forum. but my requirement was to stick with textile. and i need to have a link wrapped around img for my fancybox (yes, i only told half the truth here ;-). unfortunately yab_image does not support linked images (right?).

i know, this is off topic: trenc, you have a nice website online for NRW tourismusmagazin. did you build it with txp?

best regards, christoph

Offline

Board footer

Powered by FluxBB