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