[Resuelto] Use of a Views as a select inside a Forms don't work id additional parameters de
This support ticket is created hace 4 años, 3 meses. 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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
I'm trying to use a Views as a select inside a form (to populate a generic field).
The Views uses a filter based on a shortcode (anneeu) and I have define a hook to retur the current year as [annee_univers].
If I'm using the Views without additional shortcode parameter, that's working fine. If I add a shortcode parameter, then, the select is no more eworking inside the Forms.
Here is my Views :
View isn't really meant to pass data into our plugins like this, however could you ensure that "Disable the wrapping DIV around the View" is checked on your view setting. See Screenshot
If you view is returning the wrapper divs then this setting will disable the wrapping around it.
Unfortunately, this part of the site is not accessible for now.
If I de-active the hook, then the select does not work anymore.
Which new checkbox option are you speaking of?
Regards
Pat
OK understant concerning the checkbox. This means that this checkbox can replace the hook if I'm right!
Now, concerning the use of the Views with a parameter inside a generic field, I need to know if this is something that is feasible or not. So could you ask a Toolset developer if this is possible or just make a test in a blank site on your own?
Regards
Pat
Thanks for the info.
This is not working no more.
Have you been able to validate that this was something feasible (ie : use of shortcode parameter fliter in a views when inserting this views inside a generic field?
I have other filters that are working fine but they are not based on a shortcode !
Regards
Pat
Secondly are you able to quickly set this site up in a live environment where I can investigate or are you able to provide me with a duplicator package of the website ?
Please let me know as further debugging is needed to be done here but I will need to see the site itself in order to fully diagnose why this isn't working.
Looking at your screenshot, I'm wondering if I have been sufficiently clear in my description.
What you are displaying is working fine for me. Now, I have added a filter based on a custom field (wpcf-annee-universitaire) and define the Views filter as a shortcode linked ot the anneeu parameter).
I have also another shortcode ([annee_univers]) created with a hook in the Toolset parameters tab, and that returns the current year.
Doing this returns nothing in the generic field, but if I'm using the Views in a post, I'm getting the right value.
Another test : if I place manually a value in the gebneric field like "options":[ 2020 ], it's also working.
So it seems the issue is related to the use of a shortcode inside a shortcode as a generic field option?
Could you test your generic field with the whole context (filter parameter based on a shortcode) and tell me if this is working for you?
So in the case where you have added the parameter it won't work.
The problem is that the internal shortcode is breaking the markup for the view. You won't be able to use another shortcode within the view to filter the results.
You may need to convert your custom shortcode to a static query filter for your view using our filter hook.
Thanks,
Shane
What would be needed in the internal shortcode to comply with the Views rules?
As this shortcode is created thanks to a hook, I should be able to modify it in order to make it compliant?
Regards
Pat
Thanks for your porposal. I can use it as a workaround, but this is not solving completely my need. I think being able to use a Views ass select and define some additional parameters thanks to a shortcode is a must and should be integrated inside Toolset as standard.
Let me know if this is something that could be feasible in the near future?