• Resolved dmag55

    (@dmag55)


    My plugin’s custom post type has a bunch of taxonomies (example: image 1), which makes it a bit visually not very good. I was wondering is there a way I can group those taxonomies under one subpage and show them in tabs instead (example: image 2), while keeping their native template and functionality?

    View post on imgur.com

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator bcworkz

    (@bcworkz)

    You’d have to develop your own admin page to have a tabbed paging scheme.

    Why so many taxonomies? It appears that the plugin is abusing the intent of a taxonomy. I’d think it’d be better to have a hierarchical scheme under one or few taxonomies. What is currently a taxonomy could instead be the top level term of a single, all encompassing taxonomy. What ever terms fall under that taxonomy would be child terms below the top level term.

    Fewer taxonomies won’t address your concern, you’ll still have a whole bunch of terms in need of organization. But the site will run more efficiently without so many taxonomies.

    Thread Starter dmag55

    (@dmag55)

    I will explore the option with hierarchical scheme. Thanks for the advice.

    I understand that I would have develop tabs myself, but how can I render original taxonomy template in a tab?

    Moderator bcworkz

    (@bcworkz)

    Review edit-tags.php and do something similar for each tab, perhaps while implementing a lazy load or Ajax scheme for switching tabs. Page load will be slow if you try to load all tab content at once.

    The terms list table is generated by a WP_Terms_List_Table class object. At a minimum, call its prepare_items() method, then its display() method. When you review edit-tags.php, you’ll see there could be a whole lot of other processing between the two method calls.

    Depending on what UI elements you really want on the page, you could just get_terms() and generate your own page content as desired.

    Thread Starter dmag55

    (@dmag55)

    Depending on what UI elements you really want on the page

    I would like standard taxonomy UI of WordPress, so I will be looking to implement it that way. Thank you for the information.

    Thread Starter dmag55

    (@dmag55)

    Well, I’ve tried requiring /wp-admin/edit-tags.php in my custom menu page, while providing taxonomy=my_custom_taxonomy parameter in the url. It displayed the taxonomy UI, but with some errors, so to fix it would be too hacky for my plugin.

    All I need is to insert tabs’ html markup to the top of taxonomy template (edit-tags.php). I’ve checked edit-tags.php file – there’s no filters to insert custom html. So I was wondering, maybe there is some straightforward way to insert custom html to edit-tags.php that I’m missing?

    Moderator bcworkz

    (@bcworkz)

    "load-{$pagenow}" fires fairly early. (from admin.php). Pagenow should be “edit-tag.php” I believe. On the other end, 'admin_print_footer_scripts' (from admin-footer.php) fires fairly late. These may not be symmetrical for balancing of tags. You could start an output buffer at the start, manipulate buffer content as required, then output and flush the buffer at the end.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can I group taxonomies in one page?’ is closed to new replies.