Hi!
Thanks for your post and sorry for the trouble!
Unfortunately, I don’t know this Repeater element, so that I don’t know how it works. So, I can’t tell you why it shows the raw internal data and not the Shortcode output, sorry 🙁
Regards,
Tobias
Thread Starter
baqsny
(@baqsny)
As I can see it take values from database by post id. But what I think I need is code that i can call to get id of table so i can call it dynamically later.
-
This reply was modified 2 years, 2 months ago by
baqsny.
Hi,
yes, you would need to use the table ID somewhere. But how to use a Shortcode as the repeater content is more of a question for the Oxygen support team.
Regards,
Tobias
Thread Starter
baqsny
(@baqsny)
The question is how to get table programatically whilst in the post loop?
Hi,
you could use the Template Tag functions to print the table (if you mean that you are looping the post loop in PHP here). See https://tablepress.org/faq/documentation-template-tag-functions/
Regards,
Tobias
Thread Starter
baqsny
(@baqsny)
It’s not what I need because in those functions i need to pass id explicitly. What I need is function which will loop and print all the tables. Maybe it will be easier to understand that by giving you my use case. I have accordion element so there is “Title” and “content”. I want in each item of accordion title as table name and content as printed table.
example of accordion: https://imgur.com/a/khSsEAo
Hi,
Ah, you want to loop over all TablePress tables on the site? Is it really that many that you can’t manually list those? And what if you later add a table that you don’t want to show like that?
Regards,
Tobias
Thread Starter
baqsny
(@baqsny)
This won’t be the problem (probably) because i use this tables as pricelists.
Hi,
Okay. You could then maybe use $table_ids = TablePress::$model_table->load_all( false, false ); to get a list of all TablePress table IDs, which you can then use in the template tag functions.
Best wishes,
Tobias
Thread Starter
baqsny
(@baqsny)
I coded what I wanted, but thanks for help 🙂
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress in the plugin directory. Thanks!