Support » Plugin: WP-Table Reloaded » [Plugin: WP-Table Reloaded] Viewing tables within tabs
[Plugin: WP-Table Reloaded] Viewing tables within tabs
-
Tobias,
Great plugin. Was wondering if you are aware of any WordPress friendly tabbing plugin that would work in a page template along with wp-table-reloaded.
Would like to show three or four tables on one page and allow a user to flip through them using the tabs.
Thanks.
-
Hi,
thanks for your question.
You could try the “WordPress Post Tabs” plugin from http://wordpress.org/extend/plugins/wordpress-post-tabs/. This is known to work with WP-Table Reloaded. See http://www.inlandbasketball.com/season-5/wnl/ for an example.
Best wishes,
TobiasThanks for the reply, and that’s a nice looking example.
By coincidence, WP Post Tabs was one of the plugins I was trying. Haven’t been able to merge their php code for use on a template with yours.
Here’s the code I’m using on the template to create two of the tables, which work fine:
<?php $table_id = get_post_meta($post->ID, 'roster_id', true); wp_table_reloaded_print_table( "id=$table_id" ); ?> <?php $table_id = get_post_meta($post->ID, 'schedule_id', true); wp_table_reloaded_print_table( "id=$table_id" ); ?>
Their template code for the tabs is (from their website):
[php]<?php do_shortcode("[mytab name='TEST TAB 1']Tab1 content[/mytab]"); do_shortcode("[mytab name='TEST TAB 2']Tab2 content[/mytab];"); echo do_shortcode("[end_mytabset]");?>[/php]
I’m just not sure how to replace the “Tab1 content” and “Tab2 content” with the table code.
Any thoughts? Thanks…
Hi,
oh, I see.
What you need is either the other WP-Table Reloaded template tag functionwp_table_reloaded_get_table()
(which does not automatically echo the table HTML), or you could simply use the Shortcode now:<?php $roster_table_id = get_post_meta( $post->ID, 'roster_id', true ); do_shortcode( "[tab name='Roster'][table id={$roster_table_id} /][/tab]" ); $schedule_table_id = get_post_meta( $post->ID, 'schedule_id', true ); do_shortcode( "[tab name='Schedule'][table id={$schedule_table_id} /][/tab]" ); echo do_shortcode("[end_tabset]"); ?>
Regards,
TobiasThanks, Tobias. Works and looks great.
Hi,
very nice! Good to hear that!
Best wishes,
TobiasWhen using this approach to inserting tables into the tabs, can html also be used to insert additional content before and after the table shortcode? I keep getting error messages when I try that.
Hi,
yes, of course. I don’t see why this should not work. Just maske sure to add the HTML code correctly, either outside of PHP brackets, or in
echo
statements. There, you’ll need to watch"
and'
characters, to make sure everything is interpreted as a string.Regards,
TobiasThanks. I’ve got the tables showing fine, but my gallery isn’t visible and the paragraph appears above the tabs and under the title.
<?php get_header(); the_post(); ?> <h1 class="year"><?php the_title(); ?></h1> <?php $roster_table_id = get_post_meta( $post->ID, 'roster_id', true ); do_shortcode( "[tab name='Roster'][table id={$roster_table_id} /] [/tab]" ); $schedule_table_id = get_post_meta( $post->ID, 'schedule_id', true ); do_shortcode( "[tab name='Schedule'][table id={$schedule_table_id} /][/tab]" ); do_shortcode( "[tab name='Gallery']" ); ?> <p>Click on photo to enlarge</p> <?php $team_gallery_id = get_post_meta( $post->ID, 'gallery_id', true ); do_shortcode( "[nggallery id={$team_gallery_id} template=caption]" ); do_shortcode( "[/tab]" ); echo do_shortcode("[end_tabset]"); ?> <?php get_footer(); ?>
Hi,
I can’t see anything wrong in the code…
Can you maybe post the URL to the page where this is happening? Maybe I can find something then.Regards,
TobiasTobias,
Here’s the page I’m working on:
http://wyofootball.com/history/past-teams/2001-spartans/If I add “echo” before the Gallery shortcode, the images appear but above the tabs.
The paragraph “Click on photo to enlarge” always appears above the tabs, even though I want it to appear under the tabs only when “Gallery” is selected.
Thanks
Hi,
after checking the WordPress source code again, I found that ALL
do_shortcode()
calls do in fact need anecho
in front of them.
Can you add that to all of them? Maybe that helps.Regards,
TobiasThanks. I added the echo’s but still have the problem with the tabs appearing below the gallery. It may be an issue with the gallery shortcode.
Hi,
ok, thanks for adding that. Yes, it’s either a problem with the gallery Shortcode or with the Tabs Shortcode (I assume the latter).
Regards,
Tobias
- The topic ‘[Plugin: WP-Table Reloaded] Viewing tables within tabs’ is closed to new replies.