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-05-04 23:25:02

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Php function

Hello,

I would like to count the number of images on a specific page on a separate page that does not contain an album.

I know the php code which allows me to count the number of images presented in this album but can't seem to call the function on a separate page:

function  footer_top()
{
	//echo 'style: '.$this->style.'<br/>';
	//echo 'path: '.$this->path.'<br/>';
if ($this->hasAlbum()) 
{
		 echo '<span data-lang="fr"><p class="imagenum"><strong>'.$this->album->getNumberOfPhotos().' images dans la photothèque</strong></p></span><span data-lang="en"><p class="imagenum"><strong>'.$this->album->getNumberOfPhotos().' images in the stock photo collection</strong></p></span>';
}
	return true;
}

Does anyone have a solution?

thank you in advance
Nico

Last edited by Nico3939 (2020-05-04 23:43:59)

Offline

#2 2020-05-05 01:24:27

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Php function

In Backlight 2, I think not possible.

In Backlight 3, this would be a perfect use case for the new JSON API. See this conversation for a bit of a start:
http://community.theturninggate.net/vie … 417#p65417


Matt

The Turning Gate, http://theturninggate.net

Offline

#3 2020-05-05 16:59:26

Nico3939
Member
From: France
Registered: 2016-10-05
Posts: 235
Website

Re: Php function

Thank you very much Matthew

Offline

Board footer

Powered by FluxBB