2

In Craft we have the table field type and each column can have a type. This field type is restricted to only text, number and checkboxes. Is there a plugin to add entries field type to the column types?

And if there isn't, can someone guide me to the proper files which I should look into to modify and add the field types myself by making a new plugin.

2

Is there any reason that what you're doing can't be accomplished using a Matrix field?

If the answer is "no, a Matrix field isn't sufficient", then you'll need to build a custom plugin to handle it. Assuming that this is the path that you are taking, you'll want to get familiar with this file:

/app/templates/_includes/forms.html

These macros will help you to generate just about every field type that Craft has natively available.


I built a plugin awhile back which puts a select dropdown menu inside of a table. The table macro is pre-rendered via PHP, turning it into a string. I then output that string directly into my actual page template.

To see exactly how I did it, check out this example code...

This may not answer your question 100%, but hopefully it points you in the right direction.

  • Ok sadly in that list I cant find entriesField macro. – Moin Qidwai Jul 11 '14 at 8:06
  • Entry fields are a bit more complex, since they will need to trigger a modal window. I answered a question recently which described an Assets field, some parts of that will be very similar to your situation. You can adapt the answer there to work with Entries (instead of Assets). I'd suggest starting with the template portion of that answer, and working your way outwards from there. – Lindsey D Jul 11 '14 at 8:18
3

This question is from a long time ago, but nowadays there's a great 3rd-party plugin that lets you do this: https://github.com/engram-design/SuperTable

2

This was intentionally omitted from the table field. For more complex data stores you should use Matrix.

  • I get that but you know clients can be a pain in the butt sometime and they want it in a tabular format in the admin panel. – Moin Qidwai Jul 11 '14 at 9:39
  • 1
    In this case I would explain to the client the benefits of using Matrix over Tables. The work you'll sink into supporting entries in the Table field is probably going to be more significant than the discussion about using Matrix instead. Good luck! – Tyler Willingham Jul 11 '14 at 14:36

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.