Project

General

Profile

Actions

Bug #72779

closed

Lightbox : grouping images

Added by Michael Kasten almost 9 years ago. Updated almost 7 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Fluid Styled Content
Target version:
Start date:
2016-01-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
lightbox
Complexity:
easy
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

Normaly the rel attribute is used (imho not the best way, but doesn't matter here) for grouping images that should be show in a lightbox

The "old" "css_styled_content" works with this TypoScript:

tt_content.image.20.1.imageLinkWrap.linkParams.ATagParams.dataWrap = class="lightbox" rel="lightbox{field:uid}"}]" 

The field:uid contains the UID from the TCE, so all images get the same uid by the TCE

Now this contains "fluid_styled_content":

lib.fluidContent.settings.media.popup.linkParams.ATagParams.dataWrap = class="lightbox" rel="lightbox[{field:uid}]" 

at the first look it should be the same, but the field:uid contains the page id, so all images at on page get the same id and grouping the images is impossible.

Im not sure, but it should be somthing like this:

lib.fluidContent.settings.media.popup.linkParams.ATagParams.dataWrap = class="lightbox" rel="lightbox[{data:uid}]" 

At the long term: to use the data attribute like 'data-lightbox' is imho the better way to get a relation between the images, the rel attribute is for logical relations.


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #75408: Lightbox rel="" attribute pointing to the PID instead of the Contentobjects UIDClosedBenni Mack2016-04-05

Actions
Actions #1

Updated by Wouter Wolters over 8 years ago

  • Status changed from New to Accepted
  • Assignee deleted (Benni Mack)

Confirmed.

Actions #2

Updated by Teamgeist Medien over 8 years ago

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}]

Actions #3

Updated by Teamgeist Medien over 8 years ago

Sorry I'm not familiar with Gerrit, yet. Hope someone else can push this to Gerrit...
The argument "current" in the ViewHelper maybe also should be renamed to "contentObjectUid"

Actions #4

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48406

Actions #5

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48406

Actions #6

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48406

Actions #7

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48406

Actions #8

Updated by Gerrit Code Review over 8 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/48406

Actions #9

Updated by Torben Hansen over 7 years ago

The problem still exists in the current master branch. IMO the problem should be fixed for 8.7 LTS, since grouping of lightbox images is currently broken in Fluid Styled Content. The existing patch contains breaking changes, so maybe it is better to fix the bug with non-breaking changes.

Actions #10

Updated by Anonymous over 7 years ago

Is it real a bug of "fluid_styled_content"? And not a bug of fluid?
With "field:uid" I should get the id of the content element. But i get the id of the page.

I get the following results:
"field:uid" - id of the page, should get the id of the element
"field:pid" - id of the parent page, should get the id of the page
"field:header" - nothing, should get the headline
"page:uid" - id of the page - right
"page:pid" - id of the parent page - right
"page:title" - page title - right

Actions #11

Updated by Anonymous over 7 years ago

TypoScript to the rescue! Here's a workaround for TYPO3 8.7:

lib.contentElement.variables.10 = LOAD_REGISTER
lib.contentElement.variables.10.content_uid = TEXT
lib.contentElement.variables.10.content_uid.field = uid
lib.contentElement.settings.media.popup.linkParams.ATagParams.dataWrap = class="{$styles.content.textmedia.linkWrap.lightboxCssClass}" rel="{$styles.content.textmedia.linkWrap.lightboxRelAttribute}[{register:content_uid}]" 
lib.contentElement.stdWrap.append = RESTORE_REGISTER

Actions #12

Updated by Benni Mack almost 7 years ago

  • Sprint Focus set to On Location Sprint
Actions #13

Updated by Benjamin Kott almost 7 years ago

  • Status changed from Under Review to Rejected

This patch is highly breaking for everyone relying on this, since there is no universal implementation for this and its always relying on JavaScript in the end i will abandon this patchset as there is no real benefit, and only may work in one specific usecase.

For reference and example how to make your implementation work, please see implementation of the bootstrap_package
https://github.com/benjaminkott/bootstrap_package/blob/master/Resources/Private/Partials/ContentElements/Media/Type/Image.html#L10-L19

Actions #14

Updated by Anonymous almost 7 years ago

The solution is:

lib.fluidContent.settings.media.popup.linkParams.ATagParams.dataWrap = class="lightbox" rel="lightbox[{file:current:uid_foreign}]" 

{file:current:uid_foreign} gives the id of content element.

See also: https://forum.typo3.org/index.php?t=rview&goto=753239#msg_753239

Actions

Also available in: Atom PDF