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):
in view.php I changed line 44 to:
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:
I also tried changing the variable from 'description' to 'desc', with no result...
Any suggestions how to fix this?
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 |
Can you PM me site and ftp logins. Cheers.
Hi
Ok I changed the following code on the file view.php (the one within the templates folder):
to the following
I then edited the image properties, added a description and it worked fine.
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.
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().
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();
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