Support » Plugin: Custom Content Type Manager » Conditional Custom Fields Depending on Tempate

Viewing 1 replies (of 1 total)
  • Plugin Contributor fireproofsocks

    (@fireproofsocks)

    Someone else asked about this (see https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=481), and I’m not keen on the idea of conditional fields based on the template because it subverts the entire point of the architecture. Fields define the data model, so they belong unconditionally to a post-type. If you’re wanting to change the fields that show up when you select a template, then you’re probably blurring your view and model layers and that usually ends up messy and difficult to maintain. A template is merely a skin/view — it’s only concerned with how you wish to display data, not with what data should be allowed to be entered.

    As long as you’re clear about the architecture here and you’re only going for some eye-candy to streamline the manager, you might look into using a few custom tpls to inject some Javascript that could listen for changes and show/hide portions of the manager accordingly. Hidden fields also include some advanced options for executing some PHP on various events, so they could be used to greater effect here, but generally, I think customizations to this degree stray past the 80/20 rule.

Viewing 1 replies (of 1 total)
  • The topic ‘Conditional Custom Fields Depending on Tempate’ is closed to new replies.