Title: Conditional Custom Fields Depending on Tempate
Last modified: August 21, 2016

---

# Conditional Custom Fields Depending on Tempate

 *  Resolved [janpleva](https://wordpress.org/support/users/janpleva/)
 * (@janpleva)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/conditional-custom-fields-depending-on-tempate/)
 * Hi,
 * Is it possible to make CCTM show custom field only when I select some defined
   template and different ones when I select different template?
 * I know it is possible with add_meta_box() as explained here: [http://www.farinspace.com/page-specific-wordpress-meta-box/](http://www.farinspace.com/page-specific-wordpress-meta-box/)
   but can I do that with CCTM as it would be way more convenient…
 * Thanks
 * [http://wordpress.org/extend/plugins/custom-content-type-manager/](http://wordpress.org/extend/plugins/custom-content-type-manager/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * (@fireproofsocks)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/conditional-custom-fields-depending-on-tempate/#post-3853232)
 * Someone else asked about this (see [https://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=481](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.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-type-manager_c9c790.
   svg)
 * [Custom Content Type Manager](https://wordpress.org/plugins/custom-content-type-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-content-type-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-type-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-type-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-type-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-type-manager/reviews/)

## Tags

 * [settings](https://wordpress.org/support/topic-tag/settings/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)

 * 1 reply
 * 2 participants
 * Last reply from: [fireproofsocks](https://wordpress.org/support/users/fireproofsocks/)
 * Last activity: [12 years, 12 months ago](https://wordpress.org/support/topic/conditional-custom-fields-depending-on-tempate/#post-3853232)
 * Status: resolved