Skip Navigation

[Fermé] CRED Create and insert parent member id shortcode

This support ticket is created Il y a 9 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.87 hours from now. Thank you for your understanding.

This topic contains 19 réponses, has 3 voix.

Last updated by tony Il y a 9 années et 3 mois.

Assigned support staff: Bigul.

Auteur
Publications
#79911

Hi Tony,

try using a hidden generic field, created through the gui and give the view shortcode as value

Also if the view shortcode has quotes make sure the quotes are nested correctly

This should work, we use it in several examples and it works

So if this does not work maybe the view is not set up correctly and needs some parameter

Try using the same view shortcode both inside the generic field
and also outside just to display what it actually returns when used from inside a form

#79954

UPDATE:

when viewing the link you provided, about the view shortcode inside and ouside the field
the shortcode returns;

No posts found

So this breaks JSON,

it would be good to remove this option from the view
and use the view shortcode inside quotes (porperly nested)

eg "value": "[wpv-view view='My View']"

#79963

Hi Nikos

I think this is what I have done.

I have displayed the view shortcode immediately behind the input field.

If you log in with subscriber subscriber and go to hidden link it displays the value "838" immediately behind the input field.

838 is the code for subscriber.

The code generated by the GUI is

[cred_generic_field field="_wpcf_belongs_member_id" type="textfield" class=""]
{
"required":0,
"validate_format":0,
"persist":0,
"default":"[wpv-view name="Get Member ID"]"
}
[/cred_generic_field]

and I adjust it to

[cred_generic_field field="_wpcf_belongs_member_id" type="textfield" class=""]
{
"required":0,
"validate_format":0,
"persist":0,
"value":"[wpv-view name="Get Member ID"]"
}
[/cred_generic_field]

Note that this does not display the input field so I remove the "" to get it to show.

[cred_generic_field field="_wpcf_belongs_member_id" type="textfield" class=""]
{
"required":0,
"validate_format":0,
"persist":0,
"value":[wpv-view name="Get Member ID"]
}
[/cred_generic_field]

Re your second message, you will see "no posts found" because you are not logged in. If you log in with subscriber you will see the code.

Regards
Tony

#81875

Bigul
Supporter

Hi Tony,

Please let me know, if you need more help from us.

--
With Regards

Bigul

#81888

Hi Bigul

I have given up trying to do this for now. The view is probably returning a space after the value which would mean that things would not work anyway.

Hopefully something will turn up in the future. What is really needed is a way to specify what appears in a parent dropdown list - something that will probably be developed at some point.

Thanks for looking into this and feel free to close the thread.

Tony

Le sujet ‘[Fermé] CRED Create and insert parent member id shortcode’ est fermé à de nouvelles réponses.