What is the correct config for the "Color" input type?

Hi, I am trying out the different input types, and can’t get the “Color” type to work - is it implemented yet?

My current config is:

<input name="color" type="Color">
  <label>Color</label>
  <immutable>false</immutable>
  <indexed>true</indexed>
  <occurrences minimum="0" maximum="1"/>
</input>

I am currently using 6.0.0-SNAPSHOT, but have previously tried using this in 5.x as well.
The documentation doesn’t currently specify the code for this type.

Nice catch there Vegard =)

If I recall correctly that particular part of the docs were actually written by a developer checking what kind of API end-points we had for the different input types. So I think that is not implemented yet.

I’ll try and get somebody that knows for sure to look into this.

I had my suspisions. :wink: There are a whole lot of different input types, but only some with the correct config specified.

I found a reference to it here, but I haven’t tried installing that module yet. Seems “kitamo” was the one to commit that code, so you might hear with him?

If this is implemented sometime in the future it would be awesome, though I am a little unsure of whether it would be best to be able to specify available colors or if it should be a standard color-wheel. (HTML5 has support for color inputs). For use by editors, I think they should normally only have a few, standard options available (to keep them within the color-palette), but that might perhaps make the matter more complicated.

Thank you for reporting this. We have now updated the Docs to only display information about input types we actually have working Admin code for :stuck_out_tongue:

http://xp.readthedocs.org/en/5.3/developer/content-domain/input-types.html

So no more “color”, “money”, “phone”, or “xml”. They might appear in future updates, so stay tuned!

3 Likes