A few formatting questions

On this site: https://whatwant.ca/photog/sedra/2024-05-agm/

Can you tell me why there are 4 pagination squares, and only two pages? How do I get rid of the 2 blank ones.

And how do I adjust the height of the coloured margin on the thumbnails (I can only find widths when I look at settings).

Finally, how can I display the name of the Album as a title.

The albums are published by Lightroom.

Thanks
Charles

Those squares arenā€™t blank. The numbers inside them are the same color as the background.
check the colors in this section of the album template

image

where do you want to display it?

If you want it in the page copy, thereā€™s a sample function in the phplugins-pangolin-sample.php that you can modify. It starts on line 491 and looks like this:

/* DELETE THIS LINE
function copy_top()
{
	//echo 'style: '.$this->style.'<br/>';
	//echo 'path: '.$this->path.'<br/>';

	if ($this->hasAlbum()) {
		echo '<p>';
		echo 'Album Title: '.$this->album->getTitle().'<br/>';
		echo 'Album Description: '.$this->album->getDescription().'<br/>';
		echo 'Number of photos: '.$this->album->getNumberOfPhotos().'<br/>';
		echo '</p>';
	}
	return true;
} // END /**/

try playing with the aspect ratio

Iā€™d like the Album Title centered above the thumbnails (below the breadcrumbs of course). I uncommented the php but nothing is showing up yet.

function copy_top()
{
	//echo 'style: '.$this->style.'<br/>';
	//echo 'path: '.$this->path.'<br/>';

	if ($this->hasAlbum()) {
		echo '<p>';
		echo 'Album Title: '.$this->album->getTitle().'<br/>';
		echo '</p>';
	}
	return true;
}

My other issues were my mistake - the page was assigned to the wrong Album Template in Publisher.

did you enable phplugins in the page template?

to center and style it, you can change the html thatā€™s being echoed to something like this

echo '<h2 style="text-align:center;">';
		echo 'Album Title: '.$this->album->getTitle().'<br/>';
		echo '</h2>';

Yes itā€™s enabled because the header link that you supplied before works, but still no Title showing up.

<?php


function user_load($style, $path) {
	$g_tsvrl = explode(' ', $style); // Extract gallery type
	define ('G_STYLE', strtoupper($g_tsvrl[1])); // and set global for later
	$g_path = str_ireplace('\\','/',$path); // change \ to /
	$chunks = explode('/',$g_path); // and put into array
	define ('G_PATH', strtoupper($chunks[count($chunks)-2])); // gallery folder name is second to last
	//define ( 'TTG_SITE', ''); // set new site root for navigation, resources, etc.
}

if (defined('BACKLIGHT_HOOK')) {
	require_once(realpath(BACKLIGHT_HOOK).'/modules/module-designer/application/helpers/APHPlugins.php');
    
}

class PHPlugins extends APHPlugins
{
 

function masthead_primary_top() {
	echo'
		<a href="https://whatwant.ca/photog/sedra">
		';
	return true;
}

function masthead_primary_bottom() {
	echo'
		</a>
		';
	return true;
}
   
function copy_top()
{
	if ($this->hasAlbum()) {
		echo '<p>';
		echo 'Album Title: '.$this->album->getTitle().'<br/>';
		echo '</p>';
	}
    echo '<h2 style="text-align:center;">';
		echo 'Album Title: '.$this->album->getTitle().'<br/>';
		echo '</h2>';
	return true;
}
    } ?>

@Matthew will need to take a look

It works for me.

I have no title here:

Can you see if thereā€™s something missing in the code I posted above?

Can you try to add some text in the main copy section of the album?

1 Like

looks like thatā€™s the key.
I had earlier tried just adding the title via phplugins but that wasnā€™t working. I guess the html to hold the copy isnā€™t added unless content is added first.

It looks like some content is needed. Just a white space would be enough. Something for @Matthew to look at.

1 Like

The php code works in strange ways.

It appears you are correct that some text has to be added in the Main Copy markup. But that copy also appears and a white space doesnā€™t work. I have put ā€œTitle Testā€ in the Main Copy markup. Check out this page now: https://whatwant.ca/photog/sedra/2024-05-agm/

I figured i might as well just put HTML in the Main Copy markup, so I tried it in the Album Set template and look what happened. It has added only the first echo text line of the code from the php file above the title I entered in the Main Copy Markup (ā€œSEDRA AGMsā€) <h2 style="text-align:center;">Album Title: <br/></h2> on this page: https://whatwant.ca/photog/sedra/

Did you use &nbsp; as whitespace character? Thatā€™s what I meant.

It looks like it uses the second echo section and not the first one (the one without the if()). That would make sense since an albumset has no album.

That did it, thanks! (I should have thought of that :grinning:)

I donā€™t understand this explanation, but itā€™s working now since I didnā€™t need the text ā€œAlbum Titleā€ and I took it out. Both echo statements are wrapped in the same if, and the Album Set contains several albums and a Template Copy form field. But the title Iā€™ve put in Template Copy works. Thanks.

In the code you showed earlier, there was only one if section:

function copy_top()
{
	if ($this->hasAlbum()) {
		echo '<p>';
		echo 'Album Title: '.$this->album->getTitle().'<br/>';
		echo '</p>';
	}
    echo '<h2 style="text-align:center;">';
		echo 'Album Title: '.$this->album->getTitle().'<br/>';
		echo '</h2>';
	...

Anyway, good that it works for you know!

I forgot to say that I took out the second part without the if since it was redundant and it created a second Album Title, but this code was from the sample file so it just shows what you can do.

I still donā€™t understand why ā€œecho ā€˜Album Titleā€™ā€ placed the text ā€œAlbum Titleā€ in the Album Set, but not the ā€œ$thisā€ part with the actual title (which it should not because itā€™s referring to an Album) but the text ā€œAlbum Titleā€ seemed to have a global scope. Since I didnā€™t want it reading ā€œAlbum Title: My Titleā€ once I removed the text and left the $this statement it no longer appeared.

But as I said, it works :grinning: so Iā€™m just adding this as an explanation.

1 Like