.attachmentList
{
.xf-minorBlockContent();
display: block;
padding: @xf-paddingMedium @xf-paddingLarge;
.attachment
{
display: block;
width: auto;
background-color: transparent;
border-width: 0;
padding: 5px 0;
margin: 0;
> div { display: inline-block; }
i { width: 24px; text-align: center; }
i:before { font-size: 22px; }
.attachment-icon.attachment-icon--img img { max-height: 24px; }
.attachment-name { margin-top: 0; }
&:first-of-type { padding-top: 0; }
&:last-of-type { padding-bottom: 0; }
}
}
This would result in something similar. Can always adjust the padding/other values to your liking:
Place in extra.less
Code:.attachmentList { .xf-minorBlockContent(); display: block; padding: @xf-paddingMedium @xf-paddingLarge; .attachment { display: block; width: auto; background-color: transparent; border-width: 0; padding: 5px 0; margin: 0; > div { display: inline-block; } i { width: 24px; text-align: center; } i:before { font-size: 22px; } .attachment-icon.attachment-icon--img img { max-height: 24px; } .attachment-name { margin-top: 0; } &:first-of-type { padding-top: 0; } &:last-of-type { padding-bottom: 0; } } }
Result is:
View attachment 218795
It's actually how XF handles it, if you click the icon it works with the lightbox, name it'll open in a new window. To change that, you'll need to edit the template: attachment_macrosHi @Russ --
Thanks for doing this -- it looks good. One question though -- it seems to "break" the light-box functionality, where you can scroll between multiple images in a single screen. As I added the code, it displays per your post above, but when you click on an image, it displays singly in a new window.
Thoughts?
<a href="{{ link('attachments', $attachment) }}" target="_blank" title="{$attachment.filename}">{$attachment.filename}</a>
<xf:if is="$attachment.has_thumbnail">
<a href="{{ link('attachments', $attachment) }}" class="{{ $canView ? 'js-lbImage' : '' }}" target="_blank" title="{$attachment.filename}">{$attachment.filename}</a>
<xf:else />
<a href="{{ link('attachments', $attachment) }}" target="_blank" title="{$attachment.filename}">{$attachment.filename}</a>
</xf:if>
<xf:macro name="attachments" arg-attachments="!" arg-message="!" arg-canView="!">
<xf:if contentcheck="true">
<xf:css src="attachments.less" />
<section class="message-attachments">
<h4 class="block-textHeader">{{ phrase('attachments') }}</h4>
<ul class="attachmentList">
<xf:contentcheck>
<xf:foreach loop="$attachments" value="$attachment" if="!$message.isAttachmentEmbedded($attachment)">
<xf:macro template="attachment_macros" name="attachment_list_item"
arg-attachment="{$attachment}"
arg-canView="{$canView}" />
</xf:foreach>
</xf:contentcheck>
</ul>
</section>
</xf:if>
</xf:macro>
<xf:macro name="attachments" arg-attachments="!" arg-message="!" arg-canView="!">
<xf:if contentcheck="true">
<xf:css src="attachments.less" />
<section class="message-attachments">
<h4 class="block-textHeader">{{ phrase('attachments') }}</h4>
<xf:contentcheck>
<xf:if contentcheck="true">
<ul class="attachmentList">
<xf:contentcheck>
<xf:foreach loop="$attachments" value="$attachment" if="!$message.isAttachmentEmbedded($attachment) AND $attachment.has_thumbnail">
<xf:macro template="attachment_macros" name="attachment_list_item"
arg-attachment="{$attachment}"
arg-canView="{$canView}" />
</xf:foreach>
</xf:contentcheck>
</ul>
</xf:if>
<xf:if contentcheck="true">
<ul class="attachmentList attachmentListCustom">
<xf:contentcheck>
<xf:foreach loop="$attachments" value="$attachment" if="!$message.isAttachmentEmbedded($attachment) AND !$attachment.has_thumbnail">
<xf:macro template="attachment_macros" name="attachment_list_item"
arg-attachment="{$attachment}"
arg-canView="{$canView}" />
</xf:foreach>
</xf:contentcheck>
</ul>
</xf:if>
</xf:contentcheck>
</section>
</xf:if>
</xf:macro>
.attachmentList.attachmentListCustom
{
.xf-minorBlockContent();
display: block;
padding: @xf-paddingMedium @xf-paddingLarge;
margin-top: @xf-elementSpacer;
.attachment
{
display: block;
width: auto;
background-color: transparent;
border-width: 0;
padding: 5px 0;
margin: 0;
> div { display: inline-block; }
i { width: 24px; text-align: center; }
i:before { font-size: 22px; }
.attachment-icon.attachment-icon--img img { max-height: 24px; }
.attachment-name { margin-top: 0; }
&:first-of-type { padding-top: 0; }
&:last-of-type { padding-bottom: 0; }
}
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.