Use image description, same as title

Permalink Browser Info Environment
I made a custom template where the Image Description will be visible in a div, just like the script already provides for Slide_Caption (Title). But there is a problem with it.

It should be possible since the controller.php already pulls the description from the File Library (line 56):
$image['description'] = $f->getDescription();


in view.php I changed line 44 to:
$js[] = "{image : '" . $img['fullSrc'] . "', title : '" . htmlspecialchars($img['title'], ENT_QUOTES, APP_CHARSET) . "', description : '". htmlspecialchars($img['description'], ENT_QUOTES, APP_CHARSET) ."'}";


I changed to code in the file supersized.3.1.3.min.js so the description will be printed as I want. So this is not working, but it DOES work when I change the code in controller.php file, line 56, to:
$image['description'] = "Bla bla bla";


I also tried changing the variable from 'description' to 'desc', with no result...

Any suggestions how to fix this?

Type: Discussion
Status: New
voltage
View Replies:
senshidigital replied on at Permalink Reply
senshidigital
Can you PM me site and ftp logins. Cheers.
senshidigital replied on at Permalink Reply
senshidigital
Hi

Ok I changed the following code on the file view.php (the one within the templates folder):

<?php
$js = array();
foreach ($images as $img) {
  $js[] = "{image : '" . $img['fullSrc'] . "', title : '" . htmlspecialchars($img['title'], ENT_QUOTES, APP_CHARSET) . "'}";
}
echo implode(',', $js);
?>


to the following

<?php
$js = array();
foreach ($images as $img) {
  $js[] = "{image : '" . $img['fullSrc'] . "', title : '" . htmlspecialchars($img['description'], ENT_QUOTES, APP_CHARSET) . "'}";
}
echo implode(',', $js);
?>


I then edited the image properties, added a description and it worked fine.
voltage replied on at Permalink Reply
voltage
hey! :) I can't really find where you changed the code (I'm working in /blocks/dojo_supersized/templates/voltage-projecten/view.php), but the problem is not in the view.php file, since it works fine when i set the $description var to "bla bla bla" in controller.php

So the problem is in the file /www2/packages/dojo_supersized/blocks/dojo_supersized/controller.php, line 59, the
public function view().

// This DOES work, view.php will output 'Bla bla bla...' :
     // $image['description'] = "Bla bla bla... ";
// This DOESN'T work, the supersized script in view.php will not work at all :
     $image['description'] =  $f->getDescription();
voltage replied on at Permalink Reply
voltage
Wait, it seems to work now.. I don't really understand what's changed, but it works. It's still a bit buggy because when a description field is empty, or contains a hard return, the whole thing doesn't load.. But at least this is working! :) tnx

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.