Appending the Slideshow link to have a named anchor
globalnet
Joined: 2004-09-23
Posts: 5 |
Posted: Sat, 2010-05-01 06:18 |
I have gallery embedded in a Joomla page, and due to the amount of content above the gallery, I need to change the "View Slideshow" url from (for example): I have looked all through the files and have been unable to find what to edit. I have the anchor in place, all that remains is this link. The slideshow version if it matters is 1.0.5.1 run in the Matrix theme. Any help is appreciated. Cheers, |
|
Posts: 8339
I just happen to have put out an update to that module yesterday.
To alter the itemLinks look to modules/slideshow/module.inc
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 5
Thanks for the tip, I have found this bit of code, which I'm pretty sure is what forms the link:
/**
* @see GalleryModule::getItemLinks
*/
function getItemLinks($items, $wantsDetailedLinks, $permissions) {
$links = array();
foreach ($items as $item) {
$itemId = $item->getId();
if (isset($wantsDetailedLinks[$itemId])) {
$links[$itemId][] =
array('text' => $this->translate('View Slideshow'),
'params' => array(
'view' => 'slideshow.Slideshow','itemId' => $itemId));
}
}
return array(null, $links);
}
I have tried the add in the anchor but I'm afraid I just don't know enough php to figure out how to add that in on the end of the array after the itemID. Any advice?
Posts: 8339
I forgot we were just returning parameters and not a fully constructed link.
you can try to add your own parameter:
$links[$itemId][] = array('text' => $this->translate('View Slideshow'), 'params'=> array('view' => 'slideshow.Slideshow', 'itemId' => $itemId, 'return' => $returnUrl, '#namedanchor' => ''));
but a g2_ will be prepended in the final link - but it won't hurt to try.
The other place would be in the template(s)
themes/your theme/templates/album.tpl and photo.tpl
and modules/core/templates/blocks/ItemLinks.tpl
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 5
No such luck. The url is still malformed. Any other suggestions?
Posts: 4342
G2 doesn't support anchors (url fragments, I'm told they should be called.) In June 2008 I submitted for code review by the core team the modifications to support them but it was too late for the G2.3 cut-off, and we know what happened to G2.4...
Unfortunately there doesn't appear to be access to the ccollab website that the G2 team used anymore, otherwise you could have installed the code mods in your own installation. If anyone knows how to get access to that system let me know...
Posts: 16504
Are you talking about http://reviews.gallery2.org/ ?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 8339
I'm wondering if you could use the href param:
basically building the url yourself.
Or use jQuery or other js to append what you need <- prolly what I'd do.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 4342
Yes - service temporarily unavailable.
Posts: 16504
I've reported the issue with that site.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 4342
Probably overkill but you can modify GalleryUrlGenerator.class to allow the creation of anchors/fragments:
The new parts are 676-683 and 696-701. Syntax is then (as per the example above):
Test and use at your own risk.