Bug #75408

Lightbox rel="" attribute pointing to the PID instead of the Contentobjects UID

Added by Teamgeist Medien over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Fluid Styled Content
Target version:
-
Start date:
2016-04-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

By default the FSC constant styles.content.textmedia.linkWrap.lightboxRelAttribute has this value: lightbox[{field:uid}]

In the MediaGallery.html Partial of FSC the clickEnlarge ViewHelper is called to render the link around the image:

<ce:link.clickEnlarge image="{column.media}" configuration="{settings.media.popup}">

The ClickEnlargeViewhelper of FSC will now render the default dataWrap of FSC using the ContentObjectRenderer. The cObjRenderer will parse {field:uid} to the UID of the current Page and NOT the UID of the current Content Objects. This will make it difficult to seperate multiple gallerys on one page.

SOLUTION

Bind a "current" argument to the ViewHelper to provide the ContentObject UID.

In ClickEnlargeViewHelper.php

Add

$this->registerArgument('current', 'integer', 'The Content Object UID', false);

To the initializeArguments() function.

Then add this to the renderStatic() function:

if (isset($arguments['current'])) {
            self::getContentObjectRenderer()->setCurrentVal($arguments['current']);
        }

Now call the ViewHelper like this:

<ce:link.clickEnlarge image="{column.media}" configuration="{settings.media.popup}" current="{data.uid}">

And change the constant to lightbox[{current}]


Related issues

Is duplicate of TYPO3 Core - Bug #72779: Lightbox : grouping imagesRejected2016-01-17

Actions
#1

Updated by Wouter Wolters over 5 years ago

  • Status changed from New to Closed

Hi, this is already reported in #72779

Can you please post your solution there?
And if possible come up with a patch on Gerrit http://wiki.typo3.org/CWT?

I'll close this ticket as duplicate.

Also available in: Atom PDF