The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Cannot get shortcode inside shortcode to work
Hi,
I am trying to filter graph data using dynamic value like so:
[frm-graph fields="147,148" x_axis="145" 145_greater_than="2017-01-01" type="column data_type=total" title="Total Weekly Sales" width="100%" show_key="1" legend_position="top" 142="[get param=bname]"]
I am getting an error (attached). Seems like 1st closing brace is considered to be the final closing brace and "] is being disregarded. Anyone had that issue?
Thank you!
July 28, 2017 at 10:46 pm
Here is a shot
Attachment:
July 28, 2017 at 10:57 pm
Hmmm.... just placed this code inside Before section of the View and it works. Is this standard behavior? In the example above I am using shortcode on a page not inside View.
July 29, 2017 at 5:55 am
When you execute a shortcode on a page, your are purely running through WordPress. Out of the box, WordPress does not support nested shortcodes, which is what you are doing in your code. You are executing a nested shortcode. This isn't to say it can't be done, but when running from WordPress, you have to write your own code to recursively execute the WordPress do_shortcode() function while parsing the content of the first shortcode.
By moving the code to the view, you are running the shortcode through Formidable. Formidable is smart enough to understand what you are doing and provides the recursion so the nested shortcode executes properly.
July 29, 2017 at 7:09 pm
Thank you! Makes sense!
September 2, 2017 at 4:14 pm
I was pulling my hair out on a similar use case and the above was not working for me. I tried everything and below is what ended up working for me.
I wanted to share this, as I saw a similar route from another post from steve wells within formidable support tickets and it kept playing back to me in my head, (it just wasn't spelled out in detail for dummies like me lol). https://formidableforms.com/help-desk/graph-and-filtering/
I had to use a filter with the field ID of the dynamic value of the school, in my case '300'.
and i self referenced the originating field ID of the school that is doing the redirecting, in my case '181'.
So the filter ended up looking like this 300="[300 show=181]". If that didn't make sense, please see 'dynamic default values' instructions.
This separated the graph to just a single school view.
Then I filtered the results using [frm-field-value field_id=181 user_id=current] (as per Steve) to get the right school based on the logged in user, and that did the trick.
I hope it can help someone as an alternate fix.
Discussion closed.