Adding magnificPopup via Fluid

时间:2016-04-25 08:54:44

标签: typo3 typoscript magnific-popup

I want to add images via a DCE in Typo3. For normal images you just have to add a tick to activate jh_magificpopup for images. But within the DCE, I cant just check a box or something to add the magnificpopup. so I looked into the Source-code and found that magnificpopup adds a class named "magnificpopup to the a-tag of the images. So i tried it this way:

<f:section name="main">
<div class="row">       
<f:for each="{dce:fal(field:'images', contentObject:contentObject)}" as="fileReference" iteration="iterator">
    <div class="col-sm-6 col-md-4"> 
        <a class="magnificPopup" href="fileadmin/user_upload/{fileReference.originalFile.name}">
            <f:image src="{fileReference.uid}" alt="" treatIdAsReference="1" width="200px"/>    
        </a>
    </div>
</f:for>
</div>          

But this does not work. Any Idea what im Doing wrong? It is opening the picture in a new tab, bus just in fileview. But there should be the lightbox that should be openend on the same site.

1 个答案:

答案 0 :(得分:1)

我这样修好了。它错过了所需的课程。

<f:section name="main">
<div class="row">
<f:for each="{dce:fal(field:'images', contentObject:contentObject)}" as="fileReference" iteration="iterator">
    <div class="col-sm-6 col-md-4"> 
        <div class="image-wrap csc-textpic-imagewrap">
        <a class="magnificpopup" href="fileadmin/user_upload/{fileReference.originalFile.name}">
            <f:image src="{fileReference.uid}" alt="" treatIdAsReference="1" width="200px"/>    
        </a>
        </div>  
    </div>
</f:for>
</div>          

缺少的课程是class="image-wrap csc-textpic-imagewrap"