Create tables (with the help of forms)
no2e - January 11, 2009 - 05:20
I want to create a simple table at a node.
But I don't want to edit the code manually or to use a WYSIWYG editor (if there's one supporting tables at all).
Are there any forms?
I know tablemanager (no Drupal 6 release) and cck_table (no release at all).
I envisage ...
BASIC
- to have the buttons "New col" and "New row".
- You can drag&drop rows and cols.
- Each cell is represented as a field.
EXTENDED
- Rows/Cols/Fields(?) should have the option to offer auto-completion and/or selection features (for nodes, terms, users, ...).
- Rows/Cols/Fields(?) should have the option to be formatted, so that they only accept links for example.
- If you select a row/col/field to hold URLs, you should have the options to determine the anker, title, etc. for all these links.
But these cells (fields), which offer auto-completion for nodes/terms/users should not be same like CCK fields, because I don't want to reference a node or to tag the node with a term. These should be "plain" links only.

Any ideas?
Would be great ...
Thanks
/bump
/bump 2009-01-19
/bump 2009-01-20
/bump 2009-01-21
/bump 2009-01-22
/bump 2009-01-23
/bump 2009-01-24
/bump 2009-01-25
/bump 2009-01-26
/bump 2009-01-28
just fyi fckeditor does have
just fyi fckeditor does have table options
to simply have the nodes body be a table seems to me to be counter productive of a CMS system unless it's a table that doesn't ever change, like some kind of reference.
I would think that you would want to create a content type with custom cck field that represents each column then create a view that brings all the data from each node into a table. a step further would be to used editablefields and be able to edit the data right from the view.
Thanks for you answer! just
Thanks for you answer!
Thanks, but I don't want to use a WYSIWYG editor.
I don't understand, what you mean by "have the nodes body be a table" ...
I want to create a table inside of a node, but without fiddling with HTML - the user shall enter the data into form fields.
Hmm ... this would be a solution, but I think it's way too overkill, because the table will be big and I would have to create so much nodes just for this one table. I don't need/want the data of a single row as node ... I really only need this one table. This solution would mean that I have to create hundreds of additional nodes that I don't "need".
The next thing that comes to
The next thing that comes to mind is to theme the node by copy the node.tpl.php to your theme folder and rename it to node-[content-type].tpl.php and manually edit the template of the node.
As for modules contemplate gives you a graphical (kinda) way to edit how your node types output.
I'm no php expert by I can usually stumble through the tpl method and get what I want enough to style it the rest of the way with css.
matrix (drupal 5)
http://drupal.org/project/matrix might go in a similar direction (not sure, didn't get it right, I think), but it's for Drupal 5 only.
Any tips/help appreciated.
Matrix
Right off the bat I thought, "Oh, here's one a newbie can help out with." But reading your post again, this isn't the solution you are dreaming of:
In Drupal 6 with CCK and Views 2 there is a way of exposing your data in a table. There is even a module to drag and re-sort this table. But you don't have control over the column width or style without going into the code.
I have a simple two-column table (with multiple fields in one column) I built at:
http://motioncity.com/drupal/newbio
Good luck!
Views+CCK solution is not appropriate
Yes, but the problem is: I would have to create a node for each row / dataset. But this would be a huge overkill, I think. I just want a sort-of-"inside of a node"-table-thing.
Think of this situation:
A site about songs. Each song is represented as a node.
An additional node, which lists all the songs I listened, sorted by date. Of course, I could listen to a song several times a day, etc.
Now, with the Views+CCK solution I would have to create a new node for each time I listen to a song. Kind of 20 nodes per day (which don't offer any additional purpose/use, no user should ever see one of this nodes, only ballast) - only for one simple hand-crafted static table?
Views Again
I don't think the way you are looking at it is the way Views works. You are not creating a huge matrix of cells that you will drop data into. You are creating a sorting preference and then presenting the data in a table. So you would only be creating one "row" and then presenting the data in it. Think of theses "song listens" as "Posts" in Drupal. Views can sort these posts any which way: Last 5 posts, top 5 posts, 5 posts by a particular user.
So with views, you could present a table that has a list of people, the last 20 songs they listened to. You could offer this dynamically and you could filter the people based on criteria (show only people under 20). Is it overkill? I don't know. But I think it would work.
But your last line confuses me, "only for one simple hand-crafted static table." If you want a static table then you just need to use FCKeditor and be done with it.
In any case, I am probably at the end of my capability to help. I'm only getting up to speed with Drupal and can only look at problems through the limited lens of what I know. When you have a hammer, all the problems look like a nail.
"overkill" | and maybe an other way?
Thanks for your answer, mcfilms.
Yes - but which data? I would have to create nodes for the data consisting of (1. col) a date and (2. col) a song title.
And exactly this is the overkill I mean.
I would need a new node for every song every time I listen to it.
Now, when I see this, I think a nice solution would be to enter the "listened to" dates to the song node directly (so one CCK Date field with unlimited date entries). But is this retrievable by Views? (several Dates of the same "field", each in an own row?)
Yes, but I don't want a WYSIWYG editor. I need "pure" forms (in a way like CCK fields). A "would-be-great" feature would be the possibility to auto-complete content entered into the fields (for the 'Song' content type) and some kind of date/time field (like the CCK Date) - but not "attached" to the node, only displayed (explained in this issue for Table Manager).
----
/bump 2009-02-10
/bump 2009-02-11
/bump 2009-02-13
/bump 2009-02-16
use nodes
You keep saying "overkill", but at its core, Drupal is a node-based system. If you are using Drupal for your site and want to get it out the door, create your "listened to" list as nodes, use views to render them into a table and attach them to the song node.
If you really want this custom non-node song list, you will have to roll up your sleeves and write some code, either to create a non-wysiwyg interface that you described in your post, or some alternate solution to add the "static" table to your node without an editor widget.
Or you could just
Or you could just incessantly bump this post every few days.
http://drupal.org/project/edi
http://drupal.org/project/editview