mcatze Well-known member Apr 24, 2020 #2 In which position is this thumbnail? XFMG? Upvote 0 Downvote
gogo Well-known member Apr 24, 2020 #3 mcatze said: In which position is this thumbnail? XFMG? Click to expand... normal posts Upvote 0 Downvote
gogo Well-known member Apr 24, 2020 #4 attachment_macros Code: <img src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" /> How do I add opacity attribute to this img tag? I tried: Code: <style>div.fade {opacity:0.6;}</style> <img src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" class="fade" /> It doesn't work. Upvote 0 Downvote
attachment_macros Code: <img src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" /> How do I add opacity attribute to this img tag? I tried: Code: <style>div.fade {opacity:0.6;}</style> <img src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" class="fade" /> It doesn't work.
mcatze Well-known member Apr 24, 2020 #5 Quite simple.. Add the following code to your extra.less: Less: .bbImage { opacity: .5; &:hover { opacity: 1; } } .attachment-icon { &.attachment-icon--img { img { opacity: .5; &:hover { opacity: 1; } } } } Last edited: Apr 24, 2020 Upvote 0 Downvote
Quite simple.. Add the following code to your extra.less: Less: .bbImage { opacity: .5; &:hover { opacity: 1; } } .attachment-icon { &.attachment-icon--img { img { opacity: .5; &:hover { opacity: 1; } } } }
gogo Well-known member Apr 24, 2020 #6 nice! can i have them limited to certain usergroups only? Upvote 0 Downvote
mcatze Well-known member Apr 24, 2020 #7 Not that easy. You should add additional classes per TMS and set conditional statements per TMS like.. Code: <xf:if is="{{$xf.visitor.isMemberOf([x, y])}}"> Show content... </xf:if> Upvote 0 Downvote
Not that easy. You should add additional classes per TMS and set conditional statements per TMS like.. Code: <xf:if is="{{$xf.visitor.isMemberOf([x, y])}}"> Show content... </xf:if>
mcatze Well-known member Apr 24, 2020 #9 Create two TMS for your needs. Template: attachment_macros Modification key: AddFadeToImg Find: Code: <img src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" /> Replace: Code: <xf:if is="{{$xf.visitor.isMemberOf([3, 4])}}"> <img class="fade" src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" /> <xf:else /> $0 </xf:if> Template: lightbox_macros Modification key: AddFadeToImgAttach Find: Code: <img src="{$src}" data-url="{$dataUrl}" class="bbImage" data-zoom-target="1" {{ $alt ? 'alt="' . $alt|for_attr . '"' : '' }} style="{$styleAttr}" /> Replace: Code: <xf:if is="{{$xf.visitor.isMemberOf([3, 4])}}"> <img src="{$src}" data-url="{$dataUrl}" class="bbImage fade" data-zoom-target="1" {{ $alt ? 'alt="' . $alt|for_attr . '"' : '' }} style="{$styleAttr}" /> <xf:else /> $0 </xf:if> Replace the extra.less entry with the following: Less: .fade { opacity: .5; &:hover { opacity: 1; } } The numbers 3, 4 in <xf:if is="{{$xf.visitor.isMemberOf([3, 4])}}"> are the usergroup IDs Attachments 2020-04-24_21-29-54.webp 64 KB · Views: 2 2020-04-24_21-30-48.webp 60.1 KB · Views: 2 Upvote 0 Downvote
Create two TMS for your needs. Template: attachment_macros Modification key: AddFadeToImg Find: Code: <img src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" /> Replace: Code: <xf:if is="{{$xf.visitor.isMemberOf([3, 4])}}"> <img class="fade" src="{$attachment.thumbnail_url}" alt="{$attachment.filename}" /> <xf:else /> $0 </xf:if> Template: lightbox_macros Modification key: AddFadeToImgAttach Find: Code: <img src="{$src}" data-url="{$dataUrl}" class="bbImage" data-zoom-target="1" {{ $alt ? 'alt="' . $alt|for_attr . '"' : '' }} style="{$styleAttr}" /> Replace: Code: <xf:if is="{{$xf.visitor.isMemberOf([3, 4])}}"> <img src="{$src}" data-url="{$dataUrl}" class="bbImage fade" data-zoom-target="1" {{ $alt ? 'alt="' . $alt|for_attr . '"' : '' }} style="{$styleAttr}" /> <xf:else /> $0 </xf:if> Replace the extra.less entry with the following: Less: .fade { opacity: .5; &:hover { opacity: 1; } } The numbers 3, 4 in <xf:if is="{{$xf.visitor.isMemberOf([3, 4])}}"> are the usergroup IDs
gogo Well-known member Apr 24, 2020 #10 Please comment on my way of modification: template: bb_code_tag_attach find: Code: <img src="{$attachment.thumbnail_url}" class="bbImage {$alignClass}" style="{$styleAttr}" alt="{$alt}" /> replace: Code: <xf:if is="{{$xf.visitor.isMemberOf([1, 4])}}"> <style> .bbImage { opacity: .1; } </style> </xf:if> $0 see if I'm missing anything or whether it's not a good style of doing so.. Upvote 0 Downvote
Please comment on my way of modification: template: bb_code_tag_attach find: Code: <img src="{$attachment.thumbnail_url}" class="bbImage {$alignClass}" style="{$styleAttr}" alt="{$alt}" /> replace: Code: <xf:if is="{{$xf.visitor.isMemberOf([1, 4])}}"> <style> .bbImage { opacity: .1; } </style> </xf:if> $0 see if I'm missing anything or whether it's not a good style of doing so..
mcatze Well-known member Apr 24, 2020 #11 It works, but its dirty.. You shouldn't place a <style></style>-option between the code. Upvote 0 Downvote
gogo Well-known member Apr 24, 2020 #12 Got it. I got to that dirty method (yeah I felt something wrong with it too so I asked for your comment) before seeing your helpful solution. I learned a lot from you guys! Thanks. Upvote 0 Downvote
Got it. I got to that dirty method (yeah I felt something wrong with it too so I asked for your comment) before seeing your helpful solution. I learned a lot from you guys! Thanks.