2

Trying to figure out if this is possible using currently available add ons.

I have a client who wants to be able to pick from a pre-defined list of items in a channel entry field (or fields). He may have a list of 10 requirements to choose from, displayed with checkboxes. Only the ones that he ticks will be displayed on output in the template.

That's easy enough using the checkboxes fieldtype...

This is where it gets complicated - The list of checkboxes are the same across all channel entries (with only selected items being shown) but he wants to be able to inject further data (which differs between entries) into the pre-defined list within the publish page.

For example, if the following were a list of checkbox items:

  1. This is an item with static data
  2. This is an item with {dynamic} data
  3. This is an item with static data

Where {dynamic} appears he wants to be able to input fresh data, essentially a field within a field. Does anybody know of a way to achieve this, or possibly a work around?

Or, possibly a way to map another field to this 'placeholder'?

Many thanks

1

I can only think of using FIND and REPLACE. Something like:

{exp:low_replace find="{replace_field}" replace="#holder_text"}{checkbox_field}{/exp:low_replace}

The problem with that solution is, I'm not certain if Low Replace or any of the replace add-ons will allow you to use contents of one field to replace contents of another. It should be doable, but generally speaking, I've generally only used it to remove {segments} or to replace with predefined text, like:

{exp:low_replace find="this" replace="that"}{my_field}{/exp:low_replace}

But I'd give it a try. I don't see any reason why it wouldn't work. All the field data should be available by then, so parsing shouldn't be an issue.

1
  • Thanks, It's not the ideal way I would have liked to accomplish this but it works really well. I now have two text input fields for find and replace values. As you describe above, I've used Low Replace wrapped around a checkbox field output and the find and replace parameters use the data from these fields. Feb 10 '13 at 23:31

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.