Hi David, thank you for the help with pdf create date. It worked fine with putting template:([+pdf:CreationDate+])
in the EXIF/Template field. I also needed to take care in configuring the format of my custom date field to match the format of the pdf:CreationDate field.
I thought I’d share the final code here for reference. There’s room for improvement, but it does what I need for now.
Demo page: https://samfjallboholmar.se/mla-document-list/
TERM LIST
Short code
[mla_term_list mla_markup=dokumentfilter mla_style=dokumentfilter]
Style template
<style type='text/css'>
#[+selector+] {
margin: auto;
width: 100%;
list-style: none;
}
li {
min-inline-size: fit-content;
display: inline-block;
margin-top: 10px;
}
.mla-button, #[+selector+] [+termtag+] a {
color: #ffffff;
background: #e8c100;
padding: 5px;
margin-right:10px;
border-radius:4px;
}
.mla-button:last-of-type {
margin:0;
}
/* see mla_term_list() in media-library-assistant/includes/class-mla-shortcode-support.php */
</style>
Markup template
Arguments
taxonomy=attachment_category
number=0
mla_link_href="{+page_url+}?term_slug={+slug+}#{+itemtag_id+}"
Open
<[+itemtag+] [+itemtag_attributes+] class="[+itemtag_class+]" id="[+itemtag_id+]">
Item
<[+termtag+] [+termtag_attributes+] class="[+termtag_class+]" id="[+termtag_id+]">
<a href="[+link_url+]">[+link_text+] ([+count+])</a>
[+children+]
</[+termtag+]>
Close
</[+itemtag+]>
GALLERY
Short code
[mla_gallery attachment_category="{+template:({+request:term_slug+})+}" mla_nolink_text="Inga filer att visa. Klicka p? en av knapparna ovanf?r f?r att se filerna."]
Style template
<style type='text/css'>
#[+selector+] {
}
#[+selector+] .mla-gallery-item {
display: flex;
justify-content: space-between;
background: #f0f0f0;
margin: 0 0 10px 0;
text-align: left;
}
#[+selector+] .mla-gallery-item:hover {
background:#f7f7f7;
}
#[+selector+] img {
width:25px;
display:inline;
}
#[+selector+] .mla-gallery-item > div {
padding:10px;
}
#[+selector+] .flex {
display:flex;
}
#[+selector+] .flex >div {
margin:0 15px 0 0;
min-width: 30px;
}
.document-details {
text-align: end;
color: #777777;
font-size: 0.8em;
}
.mla-button {
color: #ffffff;
background: #e8c100;
padding: 5px;
border-radius:4px;
}
.mla-button:last-of-type {
margin:0;
</style>
Markup Template
Arguments
post_parent=all
post_mime_type=application
size=icon
columns=1
link=file
meta_key="dokdatum"
orderby=meta_value
order=DESC
mla_caption="{+title+}"
mla_rollover_text="klicka h?r"
Open
<div id='[+selector+]' class='gallery galleryid-[+id+] gallery-columns-[+columns+] gallery-size-[+size_class+]'>
<H2>[+request:current_id+]</H2>
Item
<div class="mla-gallery-item">
<div>
<div>[+link+] <span class="document-details">[+custom:dokdatum,date('j F Y')+]</span></div>
<div><a href="[+filelink_url+]"><h5>[+title+]</h5></a></div>
<div>[+description+]</div>
<div><span class="document-details">Skrivet av: [+custom:forfattare+]|[+file+]</span></div>
</div>
<div class="document-details">
<span class="mla-button">[+terms:attachment_category+]</span><br />
[+file_size,kbmb+]
</div>
</div>
Close
</div>
Thanks for great support & take care!