What if I only need to display two attachments on the home page?
Code: Select all
{% if 2 S_HAS_ATTACHMENTS %}
Code: Select all
{% if 2 S_HAS_ATTACHMENTS %}
root/ext/board3/portal/styles/prosilver/template/portal/modules/news_center.html
Code: Select all
{% if news_row.S_HAS_ATTACHMENTS %}
<dl class="attachbox">
<dt>{{ lang('ATTACHMENTS') }}</dt>
{% for attachment in news_row.attachment %}
<dd>{{ attachment.DISPLAY_ATTACHMENT }}</dd>
{% endfor %}
</dl>
{% endif %}
Code: Select all
{% if news_row.S_HAS_ATTACHMENTS %}
<details class="portal-attachment-spoiler">
<summary class="portal-attachment-spoiler-text">
{{ lang('ATTACHMENTS') }}
</summary>
<div class="portal-attachment">
<dl class="attachbox">
{% for attachment in news_row.attachment %}
<dd>{{ attachment.DISPLAY_ATTACHMENT }}</dd>
{% endfor %}
</dl>
</div>
</details>
{% endif %}
root/ext/board3/portal/styles/prosilver/theme/portal.css
Code: Select all
/* Portal Attachment Spoiler */
details.portal-attachment-spoiler {
background-color: #EDE8E0;
border: 1px solid #CDC8C0;
margin: 1em 0;
}
summary.portal-attachment-spoiler-text {
display: list-item;
cursor: pointer;
font-size: 1.1em;
padding: .5em;
}
.portal-attachment {
border-top: 1px solid #CDC8C0;
display: list-item;
cursor: pointer;
padding: .5em;
list-style-type: none;
font-size: 13px;
cursor: default;
}
.portal-attachment .attachbox {
float: none;
width: max-content;
}