Issue Bug Closed

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

Teamgeist Medien 04/05/16, 10:53 updated 04/05/16, 10:58

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

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.