Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add totals= parameter to the [bw_table] shortcode #145

Open
bobbingwide opened this issue Feb 9, 2020 · 2 comments
Open

Add totals= parameter to the [bw_table] shortcode #145

bobbingwide opened this issue Feb 9, 2020 · 2 comments
Assignees

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Feb 9, 2020

Similar to bobbingwide/oik-bob-bing-wide/issues/32 I want to be able to use the totals= parameter on the [bw_table] shortcode to be able to perform counts and sums of columns in a table.

Example:

[bw_table post_type=oik-plugins posts_per_page=100
 fields=title,blocks_catalogued,_oikp_block_count 
totals=c,t,t prefixes="Count:,Catalogued:,Delivered:"]

Ideally this functionality would also be available in any block that invokes the [bw_table] shortcode. This can come later.

I'm not yet bothered about what happens if the table is paginated.

@bobbingwide bobbingwide self-assigned this Feb 9, 2020
@bobbingwide
Copy link
Owner Author

I'm not yet bothered about what happens if the table is paginated.

In the current implementation the totals apply to the rows actually displayed.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Jan 25, 2022

The logic works for the shortcode but doesn't work in the Dynamic Content block.
As soon as you attempt to add another parameter into the parameters field the
[bw_table] shortcode reverts to displaying the default fields.

<!-- wp:oik/content-block {"shortcode":"bw_table",
"parameters":"fields=\u0022title,_oikth_template,_oikth_templates_count,_oikth_parts_count,_oikth_patterns_count,_oikth_type\u0022",
"post_type":"oik-themes","numberposts":70,"orderby":"title","order":"asc","format":""} /-->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant