Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Self spawning fields


Go to End


2 Posts   2655 Views

Avatar
mmilo

Community Member, 9 Posts

20 November 2007 at 10:09pm

Hello again. I was wondering if it was possible to create a set of admin fields that would self spawn?

For instance I would like to create a page that contains a list of items, each page might contain a variable amount of items. I would like a fieldset that starts off with one text field and a button to add more depending on how many items were required on the page.

I anticipate that the answer is no, but I figure it wouldn't hurt to ask.

Avatar
Sean

Forum Moderator, 922 Posts

25 November 2007 at 12:27pm

Sure, why not - there's a field called TableField that allows you to add multiple records (or rows of a table) inside a single TableField.

This is a similar field to the one that manages the member table in the Security section of the CMS, as well as the one in the Files & Images.

http://doc.silverstripe.com/doku.php?id=tablefield

There's also ComplexTableField for more advanced tabular data management. They're documented in the SilverStripe wiki, as linked above.

Hope this helps,

Sean