oloph
Forum Replies Created
-
Forum: Plugins
In reply to: [Media Library Assistant] Markup template for document listHi 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
Argumentstaxonomy=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
Argumentspost_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!
Forum: Plugins
In reply to: [Media Library Assistant] Markup template for document listHi David, thank you for your excellent support and patience.
Yes, I have stored the common arguments in the markup template to make the required shortcode on the page as simple as can be.Thank you for the +request… tip, that solved the selected category display with a
<H2>[+request:current_id+]</H2>
in the Open section of the template.The category buttons are in place also, using your example snippets in the documentation, and some styling is applied to the list. My webhost doesn’t provide Ghostscript so I’m not getting an thumbnails regrettedly. But here I want to display ALL files when no category is selected. Using your examples, I have
[mla_term_list mla_markup=dokumentfilter mla_style=dokumentfilter]
and
[mla_gallery attachment_category="{+template:({+request:term_slug+}|a-bad-term)+}" mla_nolink_text="Inga filer att visa. Klicka på en av knapparna ovanför för att se filerna."]
Can the gallery be fully populated when the page first loads without a category slug?
https://samfjallboholmar.se/medlemsinfoI also have a lot of metadata to add to the documents. I’m struggling to bring the Date Created property on the pdf:s over to my custom field. It’s not in the IPTC core, nor as EXIF, but listed under “File Properties” in Adobe Bridge. Is there a way to map this data to a custom field, or even get it straight from the file with a parameter in the markup template?
For me it would also be helpful if default Term List markup/style templates could be selected globally.
Best regards, Oloph
Forum: Plugins
In reply to: [Media Library Assistant] Markup template for document listHi David
Like a ketchup effect, things start to fall in place all of a sudden, after another day of reading the documentation.
I’m on my way to come up with a functional markup template. The crux for me was the syntax, I think it would be helpful to sprinkle example code around the documentation on parameter use.So far, if anyone else finds this helpful, the functional template looks like:
post_parent=all
post_mime_type=application/pdf
size=icon_only
columns=1
link=file
orderby=”name ASC”
mla_caption=”{+title+}”
mla_rollover_text=”klicka här”<div id='[+selector+]’ class=’gallery galleryid-[+id+] gallery-columns-[+columns+] gallery-size-[+size_class+]’>
<!– row-open –>
<div class=’gallery-item [+last_in_row+]’>
[+link+]
[+title+]<br />
[+terms:attachment_category+]<br />
[+file+]<br/>
[+file_size,kbmb+]<br/>
[+description+]<br/>
[+custom:dokdatum+]<br/>
[+custom:forfattare+]
</[+itemtag+]></div>
</div>
I’ll do some tag wrapping and style classes and get back with th result.
Thanks again
Oloph