2

I am changing the layout that Tridion provides for changing the content of a component. At the moment am changing the way that checkboxes work.

For example: I have a Field 'active' which now is represented in the standard way.

enter image description here

I would like to change this to: [checkbox] active.

  1. Putting them next to each other.
  2. Reversing the order (checkbox before label).
  3. removing the ':' on the label and removing the 'yes'.
  4. Changing the text size and positioning to be aligned.

Now the strange part: I did this, all the css, it showed exactly as I wanted. BUT action 1 and 2 will BREAK the bond between changing the value in the Field (on general tab) and updating this in the source.

I have no clue how this breaks it. I have been trying to re-add the eventHandeler that is set during initialisation.

$evt.addEventHandler(c.SchemaControl, "change", this.getDelegate(this.onFieldsChanged));
$evt.addEventHandler(c.IsExternal, "valuepropertychange", this.getDelegate(this.onFieldsChanged));

This does not help. At the moment I have no clue how to restore the auto update of the fields to the source. The only way I see now is by making a complete custom eventhandeler which will read out all fields, construct the correct source xml and put this as the source xml of the component.

My Questions:

  1. Why does this break?
  2. Is there an easy way to fix it?
1

Not quite a GUI extension, but functionally you can set this up to meet your four requirements:

  • Field type: text
  • Set to Category (e.g. "Status")
  • Use checkbox for multiple selections (or Radio Button if a single option)
  • Keyword (just one for now): "Active"

This gets you the fields in the form view:

  1. Next to each other
  2. Checkbox before label
  3. No ':' on the label and removing the 'yes'
  4. Positioning to be aligned

Like so:

[ ] Active

But also a few benefits, you could then:

  • Group related features into a single field
  • Set a single default or use Page or Content Types (or Event System) to set multiple defaults
  • Bulk apply "Active" to Components or Pages in the Content Manager Explorer
  • Search for "Active" items and use a Virtual Folder to see all active items
  • Add more options without changing Schemas (just new keywords)
  • Query for these in delivery (CD API if in metadata or Taxonomy if in general content fields or metadata)

Otherwise, the Boolean means authors could search for or bulk apply the value "Yes."

When it fits, I prefer "features" over Booleans when content modeling. Here are a few words on the topic: :-)

  • Yeah I considered just replacing the 'yes' with 'active'. The problem with that is that I will get the 'active' within my source file. I will need to make some of these for which the label will be +50 characters long (customer requirement). This will create allot of complexity when going to page creation and reading out these properties (will not be as reusable as the 'yes' value). – Thomas Hendrickx Aug 6 '14 at 9:10
  • Fair enough, though you have a reference to the keyword or at least could get its value or description, which can be much shorter that the keyword name (title). In terms of re-use and complexity, templating a loop over every "[field]" to change it to "[field="yes"]" can't be that hard? :-) – Alvin Reyes Aug 6 '14 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.