Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2013-01-31 04:31:05
- capatxp
- Member
- Registered: 2013-01-12
- Posts: 21
Article image + caption
I finally figured out how to add a caption to an image.
This might seem obvious to a lot of you guys, for it took me hours to figure this out.
1) suppose you upload an image, and textpattern assigns it an id of “1”
2) You write an article, and in the image box, you type “1” to link that image with your new article.
3) in the default textpattern form, after the line “<txp:if_individual_article>” (or wherever else is appropriate, for whatever your goal is) insert:
<txp:if_article_image>
<txp:images>
<txp:article_image />
<txp:image_info type="caption" wraptag="div" class="img_cap" />
</txp:images>
</txp:if_article_image />
Last edited by capatxp (2013-01-31 04:45:01)
Offline
Re: Article image + caption
A good place to see what txp tags are capable of is the wiki tag reference page
You can see there all txp tags that can gives you some idea on how to solve a lot of dilemna.
Offline
#3 2013-01-31 13:03:06
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: Article image + caption
capatxp wrote:
I finally figured out how to add a caption to an image.
This might seem obvious to a lot of you guys, for it took me hours to figure this out.
Hi capatxp,
I can understand your frustration. For some things that I don’t know yet, I myself find it pretty hard at times to find the necessary information in the docs. But we all can improve them. Hence I’m asking you: Could you help us wiki authors and name a page, where you expected to find information but didn’t get any? Or maybe you feel confident enough to write a page yourself. You can get a wiki account via this page.
Thanks!
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#4 2013-02-01 01:38:14
- capatxp
- Member
- Registered: 2013-01-12
- Posts: 21
Re: Article image + caption
Uli, I wrote a “how to” here:
http://www.textpattern.net/wiki/index.php?title=Textpattern_FAQs
I’ve never written documentation for Textpattern before, so I don’t know if it’s in the correct spot, or if done the way you guys usually do documentation. But there it is … change anything you like :)
I’ve been to Koln before, btw :) Nice city!
http://www.flickr.com/search/?w=50474735@N00&q=koln
Last edited by capatxp (2013-02-01 02:03:31)
Offline
#5 2013-02-01 04:15:28
- capatxp
- Member
- Registered: 2013-01-12
- Posts: 21
Re: Article image + caption
ah, this is even better, as it works with multiple images (separated by a comma in the article image field)
<txp:if_article_image>
<txp:images auto_detect="article" >
<txp:image />
<txp:image_info type="caption" wraptag="div" class="img_cap" />
</txp:images>
</txp:if_article_image />
Offline
#6 2013-02-01 13:39:32
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: Article image + caption
capatxp wrote:
I wrote a “how to” here
Great, thank you! Kind of you to accept my invitation!
I’ve never written documentation for Textpattern before, so I don’t know if it’s in the correct spot, or if done the way you guys usually do documentation.
Don’t worry about that, it’s cool to have a first article now for the new FAQs.
EDIT: Forgotten to mention: WOW, you’ve even made screenies and thought of linking to the new page!
http://www.flickr.com/search/?w=50474735@N00&q=koln
These are excellent photos of the cathedral! I’ve seen posters of it in lesser quality for sale at our tourism office. But even more typical of Cologne is the situation behind the Fiesta: three not working workmen turning their heads :)
Last edited by uli (2013-02-01 15:08:34)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#7 2013-02-03 22:50:15
- capatxp
- Member
- Registered: 2013-01-12
- Posts: 21
Re: Article image + caption
Thanks :)
I found another way to add a caption/cutline. This method is pretty simple. When editing an article in Textpattern’s word processor-like page, type in your article and then insert:
<txp:image id="8" />
<txp:image_info type="caption" id="8" />
Wherever you’d like a photograph and caption to appear. You’ll change the ID number as appropriate, of course.
Offline
Pages: 1