Thanks for the supportive comments and for your question. Thanks as well for the shortcode and template text. It looks like there are a few pieces missing from your examples, so I’ve filled them in as best I can. The additions may not apply to your application but they will help other MLA users who find this topic.
First, I have added two parameters to your shortcode:
[mla_tag_cloud mla_markup=tag-cloud-page mla_output=grid smallest=10 largest=10 columns=3 number=0 taxonomy=attachment_category captiontag=dd]
The taxonomy=attachment_category
parameter names the taxonomy you are composing the cloud for. The default value is “post_tag”, the WordPress “Tags” taxonomy, but I don’t use that taxonomy for attachments.
The captiontag=dd
parameter is required to populate the [+caption+]
substitution parameter. The default value for [+caption+]
is the “Description” field for the corresponding term. If your terms do not have Description values the caption will be blank.
Your “tag cloud template” looks like the “Item:” part of the template. The complete template should look something like this:
Open:
<div id='[+selector+]' class='tag-cloud tag-cloud-taxonomy-[+taxonomy+] tag-cloud-columns-[+columns+]'>
Row Open:
(you can leave this empty)
Item:
<[+itemtag+] class='tag-cloud-item [+last_in_row+]'>
<[+termtag+] class='tag-cloud-term'>[+thelink+]</[+termtag+]>
<[+captiontag+] class='wp-caption-text tag-cloud-caption'><a title="[+rollover_text+]" style="font-size: [+font_size+]pt" href="[+link_url+]">[+template:[+caption+]|Default Caption+]</a></[+captiontag+]>
</[+itemtag+]>
Row Close:
<br style="clear: both" />
Close:
</div>
I’ve added two lines to your Item: part to enclose each item in <dl>
and </dl>
tags so the grid will format correctly. I have also coded “the link to wrap around the caption” in answer to your question:
<a title="[+rollover_text+]" style="font-size: [+font_size+]pt" href="[+link_url+]">[+template:[+caption+]|Default Caption+]</a>
As you can see, to create the link you must enter the HTML markup, adding substitution parameters to adapt the link to each item. I’ve added title="[+rollover_text+]"
and style="font-size: [+font_size+]pt"
to match the links MLA generates. The href="[+link_url+]"
is the key; it sets the destination of the link.
For the text portion of the Caption I have used a Content Template to give a default caption when the term’s Description is blank:
[+template:[+caption+]|Default Caption+]
You can go back to the simpler [+caption+]
text if you don’t mind an empty Caption for terms without a Description.
Finally, you should know that the default [+link_url+]
values are not too useful for clouds associated with Media Library items. This earlier topic has more information:
Att Categories menu returns 404 error
The “Tag Cloud Item Link” section of the Settings/Media Library Assistant Documentation tab summarizes the issues and the “Tag Cloud and Gallery” section gives an example of a common alternative. The example uses the mla_link_href
parameter to change the destination URL and supply a term-specific query argument:
mla_link_href="[+page_url+]?term_slug={+slug+}"
You can either put that parameter in your shortcode or add it to the “Arguments:” part of your template. Adding it to the template makes it the new “default” link destination.
I hope that gets you the results you need for your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Thanks for a great question and for your interest in the plugin.