Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2020-01-21 07:19:53

gosselin109
Member
From: Québec, Canada
Registered: 2015-01-19
Posts: 42
Website

Caption token on Single Image Pages

Hello again!

I'd like to put my photo caption on two lines.

Like doing this

{Title}"<br>" {Caption}


Thanks

Offline

#2 2020-01-21 07:38:46

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Caption token on Single Image Pages

can't be done, html won't work in the caption field. You can add a separator, like a bar | though.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2020-01-21 07:41:59

gosselin109
Member
From: Québec, Canada
Registered: 2015-01-19
Posts: 42
Website

Re: Caption token on Single Image Pages

Hum... a way with css?

Offline

#4 2020-01-21 07:44:51

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Caption token on Single Image Pages

no. That would take separating text with html elements, like a span with a class. But html added to the caption fields will just be output as regular text.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2020-01-21 07:50:19

gosselin109
Member
From: Québec, Canada
Registered: 2015-01-19
Posts: 42
Website

Re: Caption token on Single Image Pages

Well, thanks.

last thinking !... if I don't use this caption field but add 2 separate lines below the image with css?

Offline

#6 2020-01-21 08:00:11

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Caption token on Single Image Pages

Not with css.
Would you be putting the same info below each image? if so, you might try jQuery.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#7 2020-01-21 08:03:24

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Caption token on Single Image Pages

Or maybe using the single_bottom hook in phplugins and adding the same text under each image


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#8 2020-01-21 08:24:54

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Caption token on Single Image Pages

Actually, try looking the the phplugins-pangolin-sample.php file (found in the unzipped Backlight download: backlight/custom/phplugins

check out the function starting on line 546, which displays the file name and photo dimensions above the image. This looks like it might be the best option, modifying so that the info shows under the image.

You could try using single_bottom along with $photo->getMetadata(Photo::$PHOTO_CAPTION) : '';

Not tested, but maybe:

function single_bottom()
{
	if ($this->hasPhoto()) {
		echo '<p>';
		echo 'Caption: '.$this->photo->getMetadata(Photo::$PHOTO_CAPTION).'<br/>';
		echo 'Title: '.$this->photo->getMetadata(Photo::$PHOTO_TITLE);
		echo '</p>';
	}
	return true;
} // END /**/

if you want just the caption and title and not
Caption: this is the caption 
Title: this is the title

then try removing 'Caption: '. from the caption line and 'Title: '. from the title line.

You might want to remove any tokens from the caption field in the template


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#9 2020-01-21 10:06:19

gosselin109
Member
From: Québec, Canada
Registered: 2015-01-19
Posts: 42
Website

Re: Caption token on Single Image Pages

OK. I will try that.

By the way, there is all what I want in the Metadata Display of thumbnail grid.
It may be something to be added to the large images. I think it was there in CE4.  could we ask Mat?

test

Offline

#10 2020-01-21 11:11:59

Daniel Leu
Moderator
Registered: 2012-10-11
Posts: 1,624
Website

Re: Caption token on Single Image Pages


Daniel Leu | Photography   
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com

Offline

#11 2020-01-21 11:17:51

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Caption token on Single Image Pages

gosselin109 wrote:

OK. I will try that.

By the way, there is all what I want in the Metadata Display of thumbnail grid.
It may be something to be added to the large images. I think it was there in CE4.  could we ask Mat?

http://bl2020.cyrichard.com/collec-pub/ex.png

You just did


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#12 2020-01-21 12:37:33

gosselin109
Member
From: Québec, Canada
Registered: 2015-01-19
Posts: 42
Website

Re: Caption token on Single Image Pages

thank you both of you.

Offline

Board footer

Powered by FluxBB