3

Possible Duplicate:
Pre-fill matrix field when creating new entry?

Is there a way to automatically populate a field with a fixed static value in the EE control panel publish page? Specifically in my case I'm looking to auto populate a cell within Matrix with a pre-determined fixed static value.

Natively or with the help of an addon.

3

You can use the instructions text of the custom field to insert some javascript where you can populate the field.

See Pre-fill matrix field when creating new entry?

| improve this answer | |
  • Hmmm, I didn't even think of that option. It seems a like a bit of a hack but at the same time presents some interesting opportunities. Thanks for pointing this out, I'll give it a try and let you know if it works out. – Ian Jan 27 '13 at 20:10
  • It's definitely a hack but I don't think there's another way to populate the field (without modifying Matrix). – Jason Varga Jan 27 '13 at 20:12
  • For this purpose a hack is probably good enough. It's actually quite surprising there's no way to enter a simple default field value however with all of EE & Matrix's advances. – Ian Jan 27 '13 at 20:26
  • Thats true. I can't say how easy or difficult it would be to implement it though. Would you be able to mark the answer as correct if it was helpful? – Jason Varga Jan 27 '13 at 20:31
2

Another option for you is using an add-on like MX Cloner that would allow you to clone, or copy, entries.

You could create 'default' entry with initial set of data (make sure it's status is 'closed' so it's not published on site) and ask authors to clone it when creating a new entry. That way, entries will be created already with set of required data in them.

| improve this answer | |
  • That's interesting, I didn't know about MX Cloner. I think in this case however trying to explain to the client to clone an entry wouldn't be the best workflow to their liking and it's only for a single field so that I can put a '0' it in by default to start a counter. Because the counter is so crucial to operations I don't want to have to rely on the client to enter it because if they forget then it will cause things to break. – Ian Jan 28 '13 at 22:40
1

It seems that you would like to have new field type which can put for a matrix cell and this will only populate static text (not for inputting value/s). If so, a small field type need to be developed which should be supported with matrix.

Please shed more light on your need in the case i 'm incorrect.

Thanks,

| improve this answer | |
  • Yes that's about right. It's just a standard number field however so I don't necessarily need a new custom field type, just a way to put a default value in it. – Ian Jan 27 '13 at 20:08
1

I had to set up default entries in the past and have new entries "inherit" from those. We did that with SAEF, now Safecracker, and 2 steps for new entries. We'd support just enough fields to get the entry going in step 1, redirect to a template that would populate the fields with values from the default entry, save those values and redirect back to the full entry for step 2.

You might be able to make that 1 step in Safecracker by wrapping a subset of fields in a channel entry tag for the default entry values.

| improve this answer | |
  • Hi Mark. In this case I need to auto populate the field from the control panel and not from the front-end so I don't think Safecracker will be any use to me here. Thanks for the suggestion however. – Ian Jan 28 '13 at 22:43

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