• Resolved lmpierce

    (@lmpierce)


    The website I’m working on is private membership site, so I can’t easily provide a link to the site. I love that with your plugin I can add tags to my media items and create galleries from there. My site is a family history site, so much of the content is pulled from the media library in the form of images, audio files, etc. Your plugin has opened up possibilities!

    I suspect this is something really simple, but I’ve spent days reading your documentation docs, all the forum topics related to mla gallery and mla tag cloud, looked through the example plugins and simply can’t figure out what I need to change in my short code.

    Everything works exactly as I need it too, except when the new page opens with the results, the tag cloud is still at the top of the new page. I want the “results” page to show only the gallery and not have the tag cloud visible on that newly opened page.

    Here’s the code I’m using:

    [mla_tag_cloud]
    taxonomy=attachment_tag post_mime_type=”image”
    mla_link_href=”{+page_url+}?current_id={+term_id+}”
    mla_target=”_blank”
    number=0 smallest=8 largest=22 separator=’ / ‘
    [/mla_tag_cloud]

    [mla_gallery]
    tax_query= “array ( array ( ‘taxonomy’ => ‘attachment_tag’, ‘field’ => ‘id’, ‘terms’ => array( {+template:{+request:current_id+}|1+} ) ) )”
    post_mime_type=”image”
    mla_caption=”{+title+}”
    posts_per_page=12 size=medium
    [/mla_gallery]

    [mla_gallery]
    mla_output=”paginate_links,prev_next”
    mla_link_class=”nav-links”
    tax_query= “array ( array ( ‘taxonomy’ => ‘attachment_tag’, ‘field’ => ‘id’, ‘terms’ => array( {+template:{+request:current_id+}|1+} ) ) )”
    post_mime_type=”image”
    mla_caption=”{+title+}”
    posts_per_page=12 size=medium
    [/mla_gallery]

    My knowledge of code is very basic. Any help you can give is appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for including the complete source text of your shortcodes; very helpful. Thanks as well for the positive MLA feedback. For someone whose “knowledge of code is very basic” you’re off to a great start.

    The easiest way to accomplish your goal is to trick the tag cloud shortcode by adding a parameter that will generate a query that returns no terms. You can use the ids= parameter with a value that doesn’t match any existing attachment. Of course, you only want that value on the “results” page. Here is a parameter that works on my system:

    ids="{+template:({+request:current_id+}0000)+}"
    

    When the page initially loads without any current_id the template returns an empty value and the ids= parameter is ignored. When a value is present the value is a very large number that won’t match any existing item. So, your cloud shortcode becomes:

    [mla_tag_cloud]
    taxonomy=attachment_tag post_mime_type="image"
    ids="{+template:({+request:current_id+}0000)+}"
    mla_link_href="{+page_url+}?current_id={+term_id+}"
    mla_target="_blank"
    number=0 smallest=8 largest=22 separator=' / '
    [/mla_tag_cloud]

    I hope that gives you a solution that works 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 your interest in the plugin.

    Thread Starter lmpierce

    (@lmpierce)

    Thank you! That worked perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Open gallery in new page without tag cloud still visible’ is closed to new replies.