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 /**/
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;
}
} ?>
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 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/
That did it, thanks! (I should have thought of that )
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.
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 so Iām just adding this as an explanation.