I am trying to: Auto fill a custom field in my CRED-Form with the number of children of the parent post (number of brothers) .
I have a parent view "frageforum", where all my related children "frage-antwort" (= user-questions) are listed. I putted a CRED-form into the same view, so that users can send new questions. I want to autofill a field in the CRED-form with the ongoing number of question.
I created a parametric-search-view, with filter by parent view, where I only put in the [wpv-items-count] as the output field. And created a content view "counter" with the parametric-search-view. Till here everything's good. If I place my "counter"-content-view anywhere in my output view "frageforum", it shows me the right number of children.
Now in CRED, I wanted to bring in the view as a value of a field. Like this:
[cred_field field='frage-nummer' post='frage-antwort' value='[wpv-post-body view_template="auslobung-frageforum-single-counter" id="$frageforum"]' urlparam='' readonly="true"]
But the view doesn't show only the number. Unfortunately the number is surrounded by a div.
<div id="wpv-view-layout-292-CPID287" class="js-wpv-view-layout js-wpv-layout-responsive" data-viewnumber="292-CPID287" data-pagination="{"ajax":"false","effect":"fade","duration":500,"stop_rollover":"false","cache_pages":true,"preload_pages":true,"pre_reach":1,"spinner":"default","spinner_image":"<em><u>hidden link</u></em>","callback_next":"","manage_history":"on","has_controls_in_form":"off","max_pages":0,"page":1}" data-pagepermalink="/nexttest/frageforum/510-frageforum/?wpv_view_count=292-CPID287&wpv_paged=1"> 3 </div>
Is there a way, to put in only the displayed number?
Or another way, to put the number of brother posts into a custom field of my CRED-form?
I found this post for implementing the parent ID:
https://toolset.com/forums/topic/auto-fill-parent-field-in-cred-form/page/2/
Is there a similar way to display the children-number of the parent ID?
Thanks for your help!