biber Posted August 22 Posted August 22 (edited) Some years ago I set up a site http://malabu.de which consists of a number of galleries. I built it with the "image-extra" module from justb3a to add further informations to the images. Meanwhile this module seems to be obsolete and I added fields as Custom Fields in a template "field-images". Originally I used one template "galerie.php" for all galleries, but as there are very different galleries like cooking recipes, garden images and points of view, I decide to use different templates with different legends. E.g. "ingredients" and "preparation" for the cooking-page and "places" and "stories" or "plant names" for other pages. To make it clear and simple I want to show only the relevant fields at the current admin-page, but if I add "images" to the template, all "field-images" appear. As a special goody I would like to have different placeholder for every page. Perhaps someone can help me. If this is too obscure, please ask for additional informations or screenshots. Thanks in advance, Günter Edited August 24 by biber
elabx Posted August 23 Posted August 23 I did a very weird hook using InputfieldImage::renderAdditionalFields and adding a nested hook that happens only once and removes all fields of any InputfieldWrapper before it renders. Tbh now looking at this doesn't seem like the best option 😕 It'd be clenaer if this method was hookable. 1
Robin S Posted August 23 Posted August 23 @biber, you could of course create several different images fields with different sets of custom fields. But if there's an advantage to you of just dealing with a single images field then in your custom fields setup add all the different fields (ingredients, places, etc) you need across all the different templates the field is added to (recipe, plant, etc). Then you can use the Custom Inputfield Dependencies module to only show certain fields depending on the template of the page that's open in Page Edit. 4
biber Posted August 23 Author Posted August 23 @elabx and @Robin S Thanks for Your help. I installed the Custom Inputfield Dependencies module and used "Show only if page is matched by custom find ...", which gave me a comfortable way to select the template. Now the admin-sites are clearly arranged and wrong entries can be avoided. 3
elabx Posted August 24 Posted August 24 5 hours ago, biber said: I installed the Custom Inputfield Dependencies module and used "Show only if page is matched by custom find ...", which gave me a comfortable way to select the template. Now the admin-sites are clearly arranged and wrong entries can be avoided. I have to try this module next week and remove my monstrous hooks, fantastic @Robin S, thanks! 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now