This support ticket is created Il y a 5 années et 6 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
Here is an example of something we regularily do with some Joomla CCKs we want to know how to do with Toolset
Let's define a content type we name 'galery'. The galery is a content that contains several images.
1- is there a custom field type that allows us to upload X images ?
2-is there a way to automatically generate various thumbnails for each uploaded images ?
3-when we display a 'galery' content can we add custom code to the content vew done with toolSet Layouts ?
As regards generating thumbnails, WordPress does this automatically. It has several default sizes, and you can register custom sizes, and then whenever an image is uploaded to the media gallery the various sizes are generated automatically. You can read more about that here: https://developer.wordpress.org/reference/functions/add_image_size/
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Hi Cyril
I've mentioned that to the documentation team.
Custom code: you are talking about JavaScript?
If you are using a View to display a gallery the editors within the View (e.g. the Search and Pagination editor, the Loop Output editor) have sections for adding custom JS (and also custom CSS).
no, I meant PHP code, on the server side.
the general idea is to be able to add custom code (hooks) that will perform some actions on the content view.
For example : take the value of a hidden field and appy its value as a href on another field
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
The description for the wpv_filter_content_template_output filter says "Filters the output generated by a Content Template or, in general, the content of any post."
I haven't tested it but according to that it looks like it should be triggered whether you are outputting a list of posts with a View or just outputting a single post.
It may be helpful to understand how templates work with Toolset.
A theme would normally contain a single.php file which will output various fields and the output the actual body of the post using the standard the_content() function. WordPress provides a filter for the output of this function, also the_content.
Toolset uses this filter to replace what would be output by the theme with what should be output by a Views Content Template, or a Template Layout.
My reading of the documentation for the wpv_filter_content_template_output is that it is part of this process and would be triggered even if a Toolset template were not being used, but you could always try using the native WordPress the_content filter (with a very high priority so that it hooks in later than Toolset, I'm not sure what the specific value would need to be).