Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
logic for image caption
I’d like to prepend a copyright symbol to the caption of an image. The symbol shouldn’t appear if not caption has been added.
I tried using a combination of chh_if_data and upm_image, but the © is output in all cases – whether or not a caption exists.
<p class="credit"><txp:chh_if_data>© <txp:upm_img_alt /></txp:chh_if_data></p>
Is there another way to achieve this?
thanks
Stu
Offline
Re: logic for image caption
shouldn’t you be using <txp:upm_img_caption />
?
Offline
Re: logic for image caption
yes, sorry – my typo
the same problem applies though
<p class="credit"><txp:chh_if_data>© <txp:upm_img_caption /></txp:chh_if_data></p>
Offline
Re: logic for image caption
And if for some reason chh_if_data doesn’t work, as it could be, but the changes are quite small, then you can use little tiny php statement:
<txp:php> if(upm_img_alt(array())) echo '© '; </txp:php>
Expecting that upm_img_alt is a function and not formed by custom parser – it definetly should be function, shouldn’t it? :)
Offline
Re: logic for image caption
my apologies – the chh_if_data plugin does work – I was being a numpty ;-o
sorry to waste your time
Stu
Offline
#6 2008-04-18 14:29:19
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: logic for image caption
pieman wrote:
my apologies – the chh_if_data plugin does work – I was being a numpty ;-o
So, what was the problem?
Offline
Pages: 1