• Resolved Valery Kondakoff

    (@valery-kondakoff)


    Hello!

    I just created several Att. Tags and assigned them to different attachments. Now I added the WP default Tag Cloud widget to the pages and set it to display Att. Tags.
    But when I click on a Att. Tag in a widget I receive ‘Page not found’ instead of the list of the attachments, assigned to the specific tag. The attachments are displayed correctly when I use Att. Categories instead of Att. Tags.

    Am I doing smth wrong? How to display a list of attachments assigned to a specific Att. Tag by clicking on a tag in a Tag Cloud widget?

    Thank you!

    https://www.ads-software.com/plugins/media-library-assistant/

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

    (@dglingren)

    Thanks for your question, which is a variation on earlier topics:

    404 for attachment_category pages

    Att Categories menu returns 404 error

    The second topic goes into quite a bit of detail and contains some solutions. Briefly, the WordPress “taxonomy archive pages” are designed for posts/pages and they specifically exclude Media Library items.

    The [mla_tag_cloud] shortcode can help you build your own archive pages. You can start by reading through the “Tag Cloud and Gallery” and “Tag Cloud Pagination Example” sections of the Settings/Media Library Assistant Documentation tab. Both of these summarize the techniques discussed in the earlier support topics.

    The [mla_tag_cloud] shortcode can be placed in a widget. You can use the “MLA Text” widget for this purpose or any other text widget that supports shortcodes.

    Recently MLA was enhanced with the [mla_term_list] shortcode to handle hierarchical taxonomies and other forms of taxonomy display. You can read about it in the Documentation tab and you can find a fairly advanced application in this recent topic:

    Dynamic search and filters

    I hope that gets you started on taxonomy solutions for your application. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the material in the earlier topics or the MLA Documentation. Thanks for your interest in the plugin.

    Thread Starter Valery Kondakoff

    (@valery-kondakoff)

    Hello, David!

    Thank you for your prompt and detailed answer. I have one more question though. Now I try to use the ‘MLA Text’ to display the [mla_tag_cloud] using the following code snippet:

    [mla_tag_cloud taxonomy=attachment_tag number=0 limit=10 mla_link_href="{+page_url+}?current_id={+term_id+}&mla_cloud_current={+request:mla_cloud_current+}"]
    [mla_tag_cloud taxonomy=attachment_tag number=0 limit=10 mla_output="paginate_links,prev_next"] 
    
    [mla_gallery post_mime_type=all tax_query="array ( 0 => array ( 'taxonomy' => 'attachment_tag', 'field' => 'id', 'terms' => array( {+request:current_id+} ), 'include_children' => false ) )" mla_caption="{+title+}" columns=5 posts_per_page=5 size=icon link=file] 
    
    [mla_gallery post_mime_type=all tax_query="array ( 0 => array ( 'taxonomy' => 'attachment_tag', 'field' => 'id', 'terms' => array( {+request:current_id+} ), 'include_children' => false ) )" columns=5 posts_per_page=5 mla_output="paginate_links,prev_next"]

    When I click on att_tags in widget the attachments are displayed right in the widget area. How can I display the attachments in the main page area?

    Thank you for help!

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update with the good news on your progress. Thanks as well for posting the complete text of your shortcodes; very helpful.

    The “Tag Cloud and Gallery” and “Tag Cloud Pagination Example” in the Documentation tab display both the cloud and the gallery of attachments in the body of a post/page, the “main page area“. You can move just the two [mla_tag_cloud] shortcodes to a widget and leave the two [mla_gallery] shortcodes in the body of a specific post/page.

    The widget will appear on many or all pages of your site, and when a tag value is clicked you must go back to the post/page that contains the gallery display. To do that you must change the URL portion of the mla_link_href parameter in your [mla_tag_cloud] shortcode. The value in your shortcode is mla_link_href="{+page_url+}? ..., which links back to whatever the current post/page is. To go to a specific page, e.g., “Cloud and Gallery”, just change the parameter to something like mla_link_href="{+site_url+}/cloud-and-gallery/? ..." or simply mla_link_href="/cloud-and-gallery/? ...". You can adjust the URL to match the Permalink of the post/page that contains the gallery display.

    Thread Starter Valery Kondakoff

    (@valery-kondakoff)

    Hello, David!

    Thank you for your explanations, I moved the two [mla_tag_cloud] shortcodes to a widget and leaved the two [mla_gallery] shortcodes in the body of a specific page, but now I receive a following error, when clicking on tags in [mla_tag_cloud] and loading the specified page:

    ERROR: Invalid mla_gallery tax_query = '?array'
    ERROR: Invalid mla_gallery tax_query = '?array'

    Here is what I have in widget:

    [mla_tag_cloud taxonomy=attachment_tag number=0 limit=10 mla_link_href="/filtered-by-author/?current_id={+term_id+}&mla_cloud_current={+request:mla_cloud_current+}"]
    [mla_tag_cloud taxonomy=attachment_tag number=0 limit=10 mla_output="paginate_links,prev_next"]

    Here is what I have on page:

    [mla_gallery post_mime_type=all tax_query="array ( 0 => array ( 'taxonomy' => 'attachment_tag', 'field' => 'id', 'terms' => array( {+request:current_id+} ), 'include_children' => false ) )" mla_caption="{+title+}" columns=5 posts_per_page=5 size=icon link=file] 
    
    [mla_gallery post_mime_type=all tax_query="array ( 0 => array ( 'taxonomy' => 'attachment_tag', 'field' => 'id', 'terms' => array( {+request:current_id+} ), 'include_children' => false ) )" columns=5 posts_per_page=5 mla_output="paginate_links,prev_next"]

    Please, can you help me sort this issue down? Thank you a lot for your help!

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the update and the revised shortcodes. The “ERROR: Invalid mla_gallery tax_query” messages are an unfortunate side effect of WordPress’ attempt to “improve” post/page content. You can read all about this in the “Entering Long/Complex Shortcodes” section of the Settings/Media Library Assistant tab.

    You can solve the problem in either of two ways. First, you can emclose your shortcode in <code></code> tags, which will prevent WordPress from processing the parameters. This usually works but in some themes the code tags affect the gallery display. Second, you can use the “enclosing shortcode” syntax to place the parameters between [mla_gallery][/mla_gallery] tags. This also works, and it lets you divide the parameters among several lines to make them easier to read and edit. Here are your shortcodes updated with both of the suggested fixes:

    [mla_gallery]
    post_mime_type=all
    tax_query="array ( 0 => array ( 'taxonomy' => 'attachment_tag', 'field' => 'id', 'terms' => array( {+request:current_id+} ), 'include_children' => false ) )"
    mla_caption="{+title+}"
    columns=5
    posts_per_page=5
    size=icon
    link=file
    [/mla_gallery]
    
    <code>[mla_gallery post_mime_type=all tax_query="array ( 0 => array ( 'taxonomy' => 'attachment_tag', 'field' => 'id', 'terms' => array( {+request:current_id+} ), 'include_children' => false ) )" columns=5 posts_per_page=5 mla_output="paginate_links,prev_next"]</code>

    If you decide to use the “emclosing shortcode” syntax you should do it for all of the shortcodes on the page. If you did it for just the second shortcode you would run afoul of a different WordPress shortcode parsing “feature”.

    One of the two alternatives should get you the results you need.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘'Page not found' when clicking Att. Tag in WP default Tag Cloud widget?’ is closed to new replies.