Hello!
I have One cpt named "Bookings"
I have one called "Trips"
In "trips" i adding around 10 posts
And in the post form for Bookings i like to have a Select with all the trips in it.
i cant find any solution for this or im seeking to bad 🙂
I did try this now.
and i get just a bit on the way. I tried the Radiobutton as in the support ticket you showed.
and the output value seems to be correct. but the radiobuttons is not showing.
the view: img1
the output: img2
the form: img3
and i did "Disable the wrapping DIV around the View "
Hi, that's odd, your code all looks good to me.
- Is your Toolset software up-to-date?
- Is there any extra content in the View's Output Editor panel? If you cannot see the Output Editor panel, scroll to the top right and click "Screen Options" to activate the Output Editor panel. The contents should be only:
[wpv-filter-meta-html]
[wpv-layout-meta-html]
- If you hard-code the values does the generic field show up as expected?
"Disable the wrapping div around the View" must be checked - sorry I misunderstood your comment earlier. I checked the checkbox and now the radio field appears as expected. Can you confirm this is working as expected now?
A question thou
how can i change the "--not set--" in a select and also make the select required?
And how make this be saved into a field ? What i mean that if i use "persist":1
then it is saved but the value is a post-id. i like to save the Name "package 1" instead of "346"
and in a select also i backend as frontend like if i use a select that is not an generic.
do you understand how i mean ? (see next post)
how can i change the "--not set--" in a select and also make the select required?
You would find the numeric ID of the item you want selected and place that in the "default" option. For example, if you want Package 1 preselected, you would use the ID 346 in the default setting, like this:
And how make this be saved into a field ? What i mean that if i use "persist":1
then it is saved but the value is a post-id. i like to save the Name "package 1" instead of "346"
and in a select also i backend as frontend like if i use a select that is not an generic.
There is no simple way to make a select field in the backend that has options populated by a View, or populated by all the posts in some post type. This is why you must use a generic field on the front-end of the site. The best way to save the value is to use a simple text field. Also I recommend you save the post ID, not the post title. The post title can change later, but the post ID will remain constant. Is there a specific reason you want to save the title instead of the ID?
If you insist on saving the post title instead of post ID, you must change the View and replace [wpv-post-id] with [wpv-post-title]
yes there is a specific reson why i want to save the name instead of ID. 🙂
In admin in the booking this form does ist much easier to know what the customer has selected. No one knows what 346 is.
But "package 1" all admins know what that is.
BUT (?)
Maybe i can have a generic select in back end also (?) , that select the id and shows the name instead.
Just like a manuell populated select works in toolset.
I wish to make it as simple as much to handle a booking we do with toolset without manuell populating a select in back end, and this is almost the only thing i have seen not working as smooth as everything else in toolset 🙂
It works really great. Just this last thing with select the trip (package)
so if someone needs to change what package the customer like to change, so is it much easier to change an select (or name) than an ID.
img1a is an manuell populated select. Select the selected value also in back end.
img1b is like the View with persist:1 is saved with an id. and much harder to handle in admin
I wish to make it as simple as much to handle a booking we do with toolset without manuell populating a select in back end, and this is almost the only thing i have seen not working as smooth as everything else in toolset
Right, but this is exactly what Toolset's Post Relationships and post reference fields are for. Is there a reason these features will not work in your case? Perhaps I can help you work around problems with those features instead of re-creating these fields manually and using custom code. https://toolset.com/documentation/post-relationships/