Custom Content Type Manager
[resolved] Multi-select fields: Edit an option (3 posts)

  1. muskelpower
    Posted 2 years ago #


    I've created a new content type with a multi-select custom field.
    Now I have generated a lot of entries and I want to change the value (globally) for all this entries.

    Option "red" with value "#d70000". => I want to change the value to "#a31b1b".

    But if I do this, the relation (content-to-option) is lost. Any idea?


  2. fireproofsocks
    Plugin Author

    Posted 2 years ago #

    There's no automated way to do this, unfortunately. Your best bet might be to make a backup of your database, dump it, and then do a find and replace on the values involved. In the future, consider abstracting any lists/values like this that may require changing, e.g. instead of a manually defined dropdown, instead use a MySQL query, or instead of storing a value that might change, instead store the a value that does not, and do the conversion in the view layer (i.e. your template), e.g. store "red" in your dropdown and then put code in your templates to convert red to whatever color code you need. That way you wouldn't break your associations when you change your value. This is more a question of data-modeling best practices than it is of the CCTM.

  3. muskelpower
    Posted 2 years ago #

    Okay, thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Content Type Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic