Mike,
Thanks for the additional information; I’m sure you can accomplish your goal.
The Gallery Display Style and Gallery Display Content parameters give you a lot of control over gallery content without using custom templates, but it sounds like what you want is not really a gallery at all. Your example includes mla_style=none
, but I don’t see an mla_markup=
parameter to replace the default template; are you using a custom markup template? If not, where are you putting your <a href="[+site_url+] ...
markup?
Let’s assume you’re using a custom markup template (let me know if you need tips an setting one up) called “customlink”, and you’ve added mla_markup=customlink
to your shortcode. The markup you want goes in the Item: portion of the template.
Much of what you need can be found in the Attachment-specific substitution parameters for markup templates. For example, width and height are available as [+width+] and [+height+]. However, when you say:
Is there any way of passing a width/height or class through the short code to inside the img tag? I want the user to be able to specify this per image.
do you mean you want to use a different height and width, i.e., resize the image? If that’s the case, you want the Field-level Markup Substitution Parameters instead. With these, you can pass anything you need through the shortcode to the markup inside your template. For example, change your shortcode to something like:
[mla_gallery ids="my_attachment_ID" mla_style=customlink mla_markup=customlink my_path="https://mysite.com/custom/path/" my_width=175 my_height=235]
and your Item: markup to:
<a href="[+query:my_path+][+file+]"><img src="[+query:my_path+][+file+]" id="[+attachment_ID+]" width=[+query:my_width+] height=[+query:my_height+]></a>
The query
prefix lets you pass anything from the shortcode to the markup; just be careful to choose unique parameter names.
That should get you going. Let me know if it’s unclear or if you have problems or other questions.
By the way, your custom markup template must contain something in the Open:, Row Open:, Row Close: and Close: elements. If not, it won’t be accepted and the default template will be used instead. You can add a simple HTML comment to each part. I consider this a plugin defect and I will fix it in the next release.