This project has moved and is read-only. For the latest updates, please go here.

Cascading dropdowns using Content Type drop-down?

Jan 21, 2013 at 5:58 PM

I tried to use the cascading dropdowns script to filter a "sub-type" drop-down, using the Content Type (which appears as a drop-down list in the edit form) as parent, but it did not work.  Unless I just set somethign up wrong, I am guessing it doesn't work with the Content Type drop-down because it has different markup from a normal drop-down control.  Is this correct?  Is there any way ot make this functionality work with a content type drop-down?  I have run into this requirement time and time again - users want multiple content types with distiinct metadata in the same document library.  They want a "sub-type" lookup of choices that vary by main type.  If I create a separate site column for each content type's subtypes, it complicates the views, and these site columns also all need unique names, which makes it even uglier.  It would be really nice to be able to filter the sub-types by content type.


Jan 21, 2013 at 6:04 PM

It sounds like you should have multiple Content Types which inherit from one common Content Type rather than cascading dropdowns. I can see the complications that you're describing, but I'm guessing it's more of an information architecture issue thatn anything else.

The bottom line of your question, though, is that SPCascadeDropdowns won't work with the Content Type column. You could, however, create a 'proxy" column which contains the Content Type, and is a lookup into a list containing those Content Types. 


Jan 21, 2013 at 6:10 PM

We actually do have multiple content types which inherit from one common type.  I think the architectural problem is unavoidable.  Creating a separate site column for each derived content type, containng the sub-types of that content type, is what we are trying to avoid, becuase it gives us an extra column for each content type in the library.  this is the way we have always done it in the past.  I was hoping we could use a filter on a common list to avoid it.



Jan 21, 2013 at 7:50 PM

It's certainly possible to do what you want to do, but SPCascadeDropdowns won't do it as it is currently written. The function wants all of the values to be stored in lists for lookups, as your sub-type undoubtedly already is.

You could clone the function, strip it down quite a bit, and alter it to do what you need.