Skip Navigation

[Resolved] Populate SELECT cred generic field with a VIEW

This support ticket is created 8 years, 6 months ago. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 9 replies, has 2 voices.

Last updated by MiquelC1907 8 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#342983

Hi,
I am trying to Populate a Select field (CRED generic filed) with a View output

Followed indications in https://toolset.com/forums/topic/populate-select-field-with-a-view/ , and many other posts in your support forum.

VIEW code (all in one line as suggested in some posts):

  [wpv-layout-start][wpv-items-found]<!-- wpv-loop-start --><wpv-loop>[wpv-item index=1]{"value":"[wpv-post-id]","label":"[wpv-post-title]"}[wpv-item index=other],{"value":"[wpv-post-id]","label":"[wpv-post-title]"}</wpv-loop><!-- wpv-loop-end -->[/wpv-items-found][wpv-layout-end] 

CRED code:

[cred_generic_field field="HouseName" type="select" class="" urlparam=""]
{
"required":0,
"validate_format":0,
"persist":1,
"default":[],
"options":[ [wpv-view name="Select a House"] ]
}
[/cred_generic_field]

Many thanks,

Miquel

#343009

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Miguel,

Thank you for contacting our support forum.

Could you take a screenshot of the view output so that i can have a look.

I would like to ensure that the JSON output is valid.

Thanks,
Shane

#343023
Toolset VIEW issue.png

Hi Shane,

Attached the screenshot. This page is under construction,so you'll see the content is still dummy.

Inpecting the element with google tools, I can see double quotes wrapping the JSON. Not visible in the screenshot. Just guessing the issue could be that VIEWs is outputing these additional quotes??.

If you want to check come to: hidden link

Regards,
Miquel

#343035

Hi Shane,

Just realized you won't see the same screen than me in the link I've sent, as the VIEW is filtered by Author, so you'll see no "houses", unless you log-in and create some...

Let me kno if you need something else (eg. a user to login?).

Thanks,

Miquel

#343036

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Miguel,

Could you allow me to have admin access to the website.

I would like to check on this for you to see if I can help better.

Please let me know the CRED form as well as the View that is generating the JSON.

The private fields have been enabled for your next response.

Thanks,
Shane

#343042

Inspecting with google tools, a <div> is outputed by the VIEWs shortcode:

<div id="wpv-view-layout-5365-CATTR892bf3be5c451b2b8241395f4a49da31CPID4938" class="js-wpv-view-layout">
" JSON stuff"
</div>
#343044

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Miguel,

Please provide me with an admin login so I can check on this for you.

The private fields have been enabled.

Thanks,
Shane

#343046

The Form is: "Select a House Form"
The View: "Select a House"

Where do I enter the private data??

#343049

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Miguel,

Thats strange i've enabled the fields.

Could you try again.

Thanks,
Shane

#343085

Hi Shane,

I've fixed the issue.

I've just done the view from scratch.
This morning I've already tried to duplicate the VIEW, before contacting you, but it didn't fix the problem.

It seems the VIEW was "corrupted", as when doing tests, I'd changed the kind of view (I think to parametric), and after moving back to display "All results", I guess some rubish configuration params left......

Thanks,

Miquel

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.