I am fighting since days with this situation:
I have a Select field with around 150 item and depending on a selected item a list of icons and names should be shown (around 50). The list of items (names and an url for an icon) comes from an API.
I am calling this API withing the variable component of a plugin. I have to do it with PHP, AJAX API call is not possible in my case. So right now I am putting the whole content in a string and spitting that string out in twig. Resulting in a 37,6 MB document. So this is not the solution...
My thought is now to return an array of the API in my variable component and grab just the DATA I need on the change event of the select field.
Is that possible? Can I use the include statement of twig with AJAX? Or grab data from the variable in the plugin with JS?
I am really not getting forward with this and it's driving me mad !