I am calling a view through render_view($args) in php.
This view selects and displays the body of a custom post that has itself a [wpv-view name="myNestedView"] in it.
This nested view tries to filter posts based an attribute set in $args but it does not seems available through VIEW_PARAM("myArgsAttribute") filter query.
In other words, the following is being performed :
- A bunch of attributes are set in $args, including title="myParentViewName".
- render_view($args) is being called from php, rendering "myParentViewName".
- myParentViewName selects a post through the filter using a value in $args, and displays the post body
- That post body contains a wpv-view shortcode calling a child view "myNestedView".
- That child view does not seem to have access to attributes set in $args.
Should I expect the nested view to have access to all the attributes set in $args?
If so, what am I doing wrong? What would be the workaround?
Query filter myCustomPostField1 == myattribute1
Displays [wpv-post-body view_template="None"] of the selected post that matches the query above
The child view shortcode is located in the body of the post displayed by the parent view.
myChildView
Query filter myCustomPostField2 == myattribute2 {{is myattribute2 supposed to be available in this context???}}
Display [wpv-post-body view_template="None"]
I'm sorry there is no easy ways to really copy and paste my exact code, as I have about 100's arguments generated programatically from an graivty forms entry object. However, my $args are 100% passing to my "parent view" no problem there. My question is about if those $args will be passed or not to a child view, when that child view is called from a shortcode located inside the body of a post selected by a parent view.
I want to do that:
render_view($args) => [wpv-post-body] => [wpv-view] => {{are $args still supposed to be available here???}}
I am not doing :
render_view($args) => [wpv-view] => content is returned
In other words, the parent view does not call directly the child view in the "Loop Ouput Editor". It calls the body of a post that has a view shortcode. Again, while this works, it does not seems like $args follow all the way through.
Please answer the specific question. Are $args supposed to be passed to the child view in that situation?
Doh, my bad - somehow I managed to miss the last 7 lines of your previous reply where you explain main part and described where you added the view in your long reply.
Ok - so in situation when you have added the child view in post body I do not see its possible as you can access the passed argument to view's in scope of view not post body.