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.
You are not logged in.
You have an idea and are not certain, why don't just try it? Worst Case it doesn't work and you remove the code ;-)
function footer_top() {
$posts = $this->dlp_get_wp_rest_response("https://yoursite.domain/backlight/api/get_album/12345");
echo "Array length: " . count($posts['album']['photos']);
}
I hope I didn't made any typos ;-)
I wrote up a small example for you, Nicolas. This is plain php and you can use it in your phplugins file. Just use the example code where you like to have the count, such as inside the footer. Have fun!
You need to make new Album Templates using the Pangolin Page Templates
Remember, the Page Templates that are used by Album and Album Set Templates. Album and Album Set Templates is what you select in Lightroom.
The error is because you introduce a syntax error. The single quotes are there to terminate the string that started after the echo statement.
Using double quotes should do the trick:
backlight.getAlbum("12345", {...
Are you running it on MAMP?
Do you have a backup of your computer's data?
Ah. html. Markdown doesn't work, but html does. That's too easy.
When in doubt, test....
That should be my new signature
Love this one!
In this case, you'll need to ask your host's technical support to enable it.
To post an image here in the forum, please see https://www.bbcode.org/examples/?id=10
This would look like this for you:
It looks like you are using a single column layout for your blog. Are you using any widgets? If you do, you might need to switch to a 2 column layout for your blog.
You can do this with phplugins using the head function.
A very long time ago, I wrote this before Backlight added support for the cookie message:
function head( ) {
echo '
<script src="/backlight/custom/js/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#efefef",
"text": "#404040"
},
"button": {
"background": "#ffffff",
"text": "#ff0000"
}
},
"theme": "edgeless",
"content": {
"message": "By continuing to use the site, you agree to the use of cookies. You can find out more by following this ",
"dismiss": "OK",
"link": "link",
"href": "/cookie_policy.php"
}
})});
</script>';
}
This shows you how you can add your script.
Well, This is embarrassing!
I have the same issue. Bought Backlight3. Clicked the Update link and site says it is still Backlight2. Tried the change email link as above and no deal. Link to screenshot below....
I think you used two different emails when you bought Backlight 2 and Backlight 3. If you have identified the two emails, contact Matt so he can update the system first.
There is a newer version available. You can download it from Backlight > Admin > Backlight Modules page.
Single image pages are there, among others, for SEO. So I would discourage disabling them.
What version of PHP should I have running on Bluehost?
I would try to select the oldest possible and check if you can log in and do the module upgrades. After the upgrade, select the newest one.
How about just using
{Caption|Title}, {Copyright}
Thanks Rod, but it seems we can make a line break in LUA by using "\n" or "\r"
But it don’t work or I forget something
I think this has to do with the internal processing of Lr, Backlight, and the display engine where line breaks can break the code.
very cool Daniel. I got to learn something new today!!
Yeah, me too
And this is with two decimal points:
Native dimensions: {CroppedWidth} x {CroppedHeight}px | {LUA= return string.format("%.2f",CroppedWidth/300*2.54)} x {LUA= return string.format("%.2f",CroppedHeight/300*2.54)} cm | {LUA= return string.format("%.2f",CroppedWidth/300)} x {LUA= return string.format("%.2f",CroppedHeight/300)} inches | 300dpi
This turned out more challenging as expected, although the result looks rather straightforward
Native dimensions: {CroppedWidth} x {CroppedHeight}px | {LUA= return math.floor(CroppedWidth/300*2.54)} x {LUA= return math.floor(CroppedHeight/300*2.54)} cm | {LUA= return math.floor(CroppedWidth/300)} x {LUA= return math.floor(CroppedHeight/300)} inches | 300dpi
Just be aware by using phplugins, you will spend more time maintaining your site. You have to verify many things that would work out of the box by sticking to the default implementation!
This is a simplified example of what I use on my site and is obviously based on existing backlight code:
function single_top( ){
$photo = $this->photo;
$album = $this->album;
$back = $album->getIndexPageForPhoto($photo);
$img_title = $photo->hasMetadata(Photo::$PHOTO_TITLE) ? $photo->getMetadata(Photo::$PHOTO_TITLE) : $photo->getFilename();
$img_caption = $photo->hasMetadata(Photo::$PHOTO_CAPTION) ? $photo->getMetadata(Photo::$PHOTO_CAPTION) : '';
$img_alt = $photo->hasMetadata(Photo::$PHOTO_CAPTION) ? $photo->getMetadata(Photo::$PHOTO_CAPTION) : $img_title;
$ph_id = $photo->getItemNumber();
$ph_path = $photo->getUrl('photos');
$ph_w = $photo->getPhotoWidth();
$ph_h = $photo->getPhotoHeight();
echo '<h1>'. $img_title .'</h1>';
// Top Bar
echo '<ul class="single_icons" style="max-width:' .$ph_w.'px;">';
if ($back) echo '<li class="single_image_back"><a href="'.$back.'"><span>Album</span></a></li>';
echo '<li><button class="add-to-cart" data-item="'.$photo->getItemNumber().'" data-name="'.$photo->getItemName().'" data-price="'.$photo->getMetadata("itemPricing").'" data-thumbnail="'.$photo->getURL("thumbnails-for-mobile").'"></button></li>';
?>
</ul>
<figure id="fig-<?php echo $ph_id?>" class="single_image" itemscope itemtype="http://schema.org/ImageObject" style="max-width:<?php echo $ph_w;?>px;">
<img src="<?php echo $ph_path?>" id="photo-<?php echo $ph_id?>" height="<?php echo $ph_h?>" width="<?php echo $ph_w ?>" style="width: <?php echo $ph_w?>px;" alt="<?php echo $img_alt?>" />
<figcaption"><?php echo $img_caption?></figcaption>
</figure>
<?php
return false;
}
But note that this code doesn't support the backlight 'alt image' option or language customizations.
Yes, the css needs more specificity:
ul.single_icons .single_image_next,
ul.single_icons .single_image_prev
{
display: none;
}
But if one clicks on the image, then you advance to the next image anyway. The solution for that would be phplugins where you replace the image content. I think you know now how to do this ;-)