#1170 – Edit Raw Value of plugin_showtime_field

Status: Closed - Category: Showtime Image Gallery
Hi Lefteris,

I have another question. With Joomla 3 we used Helix Ultimate Template and its Article Gallery function and were able to get the first image of the gallery in the category blog layout. So we could display it next to the text.

This was really cool because our customer can create the articles by himself and the image in the category does not have to be selected or uploaded into the article intro image.

I was trying to reach this with your plugin (plugin_showtime_fields). I made an override for the carousel layout that is correctly displayed in the article details. But if I try to get the first picture in the category block by "$this->item->jcfields['ID of the field'], there the value is the whole gallery like in my carousel override and the rawvalue is just the ID of the gallery.

I am able to get the image path, when I put a span with a class and two special glyphs at the beginning of the override, like this:
echo '<span class="first-image">♥'.$gallery->images[0]->preview.'♥</span>';
Then I can explode the value of the custom fiels at the ♥ and have the correct path to the image. But then the span is also at the article details page where I have to hide it with CSS. I am not that happy with this solution.

Can you think of a more clever way how I can get the single images paths? Or maybe just the first, that would be sufficient.

Kind regards,
Tanja
Hi Tanja,

Probably I am not getting something. As you wrote, the first image data is available in the array:
$gallery->images[0]


What's the extra data you need?

If you have only the ID then you can get the gallery data using the code below:
require_once JPATH_ADMINISTRATOR . '/components/com_showtime/helpers/showtime.php';
$gallery = ShowtimeHelper::gallery($galleryId);


If you want to have different output on your layout based on the view then you can use something like this:
use Joomla\CMS\Factory;
$app   = Factory::getApplication();
$input = $app->getInput();
$view = $input->getCmd('view');
if($view === 'article') {

} else {

}


Regards
 
Hi Lefteris,

The one with the showtime helper is exactly what I need.

Until now I had to create this invisible span in the field layout file and there integrate the $gallery->images[0] so that in my category blog I could exploade this span.

But with this solution I can get the values without creating this span and get the data of the gallery in the category blog layout file.

Thank you very much, this really helps!

Kind regards,
Tanja
You are welcome.
 
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.

Note: An active subscription is required in order to get support for our paid extensions. For our free extensions, if you don't have an account, register and then submit your support request.  In case you just want to ask a question, you can also use the contact form .

Note: Our support team is currently on vacation, so please anticipate slightly longer response times. Thank you for your understanding!

Firecoders
Are you using our extensions? Please post a review at the Joomla extensions directory!
Post a review