[ITD] Attachment Icons II

[ITD] Attachment Icons II 2.1.7

No permission to download
Perhaps you can help me to get it working:)
I uploaded it, installed it from the admin CP and that's all. Was I meant to make any changes in the config of XF2?
 

Masetrix

Well-known member
You have to click as per below image

View attachment 213060
If forum users can click an icon, they do it.
If the icon is then linked incorrectly, this results in a "404 not found" and users complain why an icon is linked if it does not work.

Can you fix the link, or at least remove it if it doesn't already work? Thank you for your work because the addon is otherwise very good.
Code:
<a href="{xf:link attachments, $attachment}" target="_blank"><img src="https://www.auer.url/styles/default/ITD/attach-icon/doc-itd-icon.png" alt="Kosten gemäß § 63 SGB X.doc"></a>

The broken link in the icon is also a disaster for SEO ...
 
Last edited:

Masetrix

Well-known member
Perhaps you can help me to get it working:)
I uploaded it, installed it from the admin CP and that's all. Was I meant to make any changes in the config of XF2?
You don't have to do anything, you just have to open a post that contains a corresponding attachment (.pdf, .doc) ... Or upload a pdf file and voila...
 
I installed it ok, this is what the Add-ons screen shows:
Screen Shot 2020-02-25 at 19.27.12.png
However, this is what a post with attachments now looks like - no attachment logos:
Screen Shot 2020-02-25 at 19.28.21.png

I am using the template and css scripts as shown in this thread:

whose contents I attempt to paste below - do you think there could be some conflict between these scripts and yours?......
Thanks,
Mike
Quote:

If you wanted to create a different look for attachments vs images... this appears to work.

The result is something like this:

Screenshot_2.png


Template:" message_macros"

Find:

Code:
<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>
Replace with:

Code:
<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>

Then the CSS:

Code:
.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; }
}
}
 
Last edited:

Mian Shahid

Well-known member
I installed it ok, this is what the Add-ons screen shows:
View attachment 219254
However, this is what a post with attachments now looks like - no attachment logos:
View attachment 219255

I am using the template and css scripts as shown in this thread:

whose contents I attempt to paste below - do you think there could be some conflict between these scripts and yours?......
Thanks,
Mike
Quote:

If you wanted to create a different look for attachments vs images... this appears to work.

The result is something like this:

Screenshot_2.png


Template:" message_macros"

Find:

Code:
<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>
Replace with:

Code:
<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>

Then the CSS:

Code:
.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;

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; }
}
}
Looks like you didn't upload or installed any icon set for this addon, kindly also add link described in additional requirement :)

Also please note their is not icon for image attachments. ;)
 

Mian Shahid

Well-known member
If forum users can click an icon, they do it.
If the icon is then linked incorrectly, this results in a "404 not found" and users complain why an icon is linked if it does not work.

Can you fix the link, or at least remove it if it doesn't already work? Thank you for your work because the addon is otherwise very good.
Code:
<a href="{xf:link attachments, $attachment}" target="_blank"><img src="https://www.auer.url/styles/default/ITD/attach-icon/doc-itd-icon.png" alt="Kosten gemäß § 63 SGB X.doc"></a>

The broken link in the icon is also a disaster for SEO ...
I will try to fix this issue in a day or two :)
 
Top