By Eep² on
I have a very complex comparison table at http://tnlc.com/eep/compare/table.html and am trying to use Drupal to "database" it but I don't believe any of the existing table addons can do it. Any ideas how I could implement it with Drupal (with all of its row/colspans, sortable by game and feature)? Thanks.
Comments
Tablemanager should be able
Tablemanager should be able to handle it, you can use attributes to define the row and col spans (else you can use || for colspans).
Pobster
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------
Well, Table Manager seems to
Well, Table Manager seems to allow table creation but what I want is automated table creation based on node fields. In this specific case (of a 3D game comparison), I want the table to list games and their features (developer, publisher, genre, year released, etc) and allow multiple games in the table and to show all or certain features. How would I do this with Table Manager and Drupal?
(This forum needs email notification of new replies--or at least a web feed...)
Hmmm... You didn't mention that before...
Nah you can't do that with Tablemanager and tbh, I doubt you'll be able to do it with any table creation utilities. It sounds a little bit too specific, I guess you might be able to do it with views but you'll be severely restricted with how you can present the table. It'll be pretty obvious how to get the data into it using views (table view, fields, etc) just as I said above, I think you'll struggle with column and row spanning.
Pobster
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------
How can I get a matrix/table
How can I get a matrix/table in Drupal to accept input from other nodes? Table Manager and the Matrix CCK modules don't seem to able to allow a cell to have entries from, say, a pull-down list of another node. I can go the other way, and have a node show a table, though, but not a table cell show a node. It must be possible--at least with PHP or some other kind of code, if it's not built-in to the modules...
Note: this text-entry form needs a WYSIWYG editor and the site is very slow at times (especially when searching).
Things like that will be
Things like that will be easier with the next version of Tablemanager but it's a way off being finished yet and I've got to move house (again) in a month or so and that'll put the 'release' date back a little further unfortunately...
...And yes, it's easily do-able but I don't know how well you know php to explain it to you?
Pobster
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------
Maybe the php snippets page
Maybe the php snippets page in the handbook will be helpful for you?
Pobster
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------
Well...
I don't know those modules, but I know that CCK's text select box, for example can contain a MySql query to build the selection options from another table.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
If I was going to bother
If I was going to bother doing MySQL queries I'd just do a proper database and not even bother with a CMS like Drupal...
This is how Drupal works
Drupal is very powerful and is designed to be easily extended. The extensibility sometimes requires snippets of code to be used. That is far simpler and easier to maintain than writing "a proper database."
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Also, part of the problem is
Also, part of the problem is I'm still not sure how to even design the table structure--whether in a database or as Drupal nodes. I'm trying to do it relationally but I just don't quite know when to stop relating since, in theory, every feature could be included in every other feature. For example, I have a "companies" table which lists company (developer and publisher) names and websites. However, do I reference the "website" field to a separate table, since I also have a "website" field in the "games" and "engines" tables? It gets confusing...and I'm not even to the far more complex design of which engine special effects can be applied to multiple feaures (particle effects, player character, atmospheric/environmental effects, etc)! Database design sux...
That's why
That's why some companies make big bucks selling database design tools. And I'm sure those tools would tell you to normalize a "website" field into its own table if it occurs in several places. I'm having the same quandary over "State."
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
Right, normalize, normalize,
Right, normalize, normalize, normalize, but, know what? You can normalize every word into a separate table, if you wanted. At what point do you stop normalizing and yet accept duplicated data? That's the Catch-22 of database normalization, to me. Basically in terms of categorization, it equates to having every word as a category. At what point does such overcategorization become useless? Granted, I can see instances when it would be useful (as in a search engine), but when does categorization stop and search begin?
This is why I prefer a table that has
colspan/rowspanattributes where duplicate data is reduced. Unfortunately, it's a bitch to edit manually (and I have yet to come across an app that can auto-format database output in such a way, but it's entirely possible, of course--and most likely already exists).Colspan question
I've been working with tablemanager and can't figure out how to define colspans. Would you be able to offer more detail?
Thanks.
It's a 'hidden' feature in a
It's a 'hidden' feature in a way as I can't be bothered with all the questions I'll get about it... Just enter || in a cell and it'll automatically be column spanned. Else... Just use attributes as you normally would inside a cell like [colspan=3] and then leave the rest of the cells blank.
Pobster
edit: Okay it seems that I removed colspan from the attributes function, to stick it back in find this function:
And simply add it back into the list somewhere (anywhere) in the same way the rest are entered (...class|colspan|valign)
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------
Thank you
Worked like a charm, and I apologize about posting this question twice. I saw it mentioned, and spent three days trying to figure it out and was quite frustrated. Being new to drupal, I am still figuring out how to do all of this, and will heed your advice about posting questions in the future.
Thanks for the great module! I had spent far too much time looking for a table creation tool and am very happy with tablemanager and look forward to future releases and appreciate all of your hard work.
Thanks again.
Hiya, thank you for your
Hiya, thank you for your kind comments!
I'm sure you'll be very pleased with the next release (which unfortunately isn't exactly imminent as I'm moving house) it's a whole lot more flexible and works faster and more comprehensively, it now allows for regexp parameters in returning results (which isn't as scary as it sounds!) and also allows for simple spreadsheet type macros to be in cells as well. It's a nice step forwards, I'm just trying to find time to iron out some issues and give it some thorough testing and then I'll make a dev release available soon.
Pobster
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------
Perhaps this might be best
Perhaps this might be best done with divs and css.
The example table basically "groups" those rows and columns that belong to the same kind.
Each sucesive value can be checked against the previous column or row.
That lets you see if it belongs to the same cell, and then print or skip it.
Of course, there's no module or script to do this so it must be coded manually.
Right...and figuring that
Right...and figuring that out is the tricky part. While it would be nice later on, but I need to first figure out how to organize all of the tables and "normalize" everything since, either going with a full-fledged database, or a CMS like Drupal, I need to get the basic design down first. I've given it some tries at http://tnlc.com/eep/compare/database.html but I'm just not sure how to proceed and if I'm even on the right track...
Don't forget caching of the
Don't forget caching of the data.
This may cut down some of the heavier work with the database.
cck fields are cached automatically within the node, avoiding possible slow queries.
Now, samples of building a table with theme('table') are here: http://drupal.org/node/87367
In your case, the difference is that nodes will show in columns instead of rows.
To do this you need to keep track of the rows and columns to add the proper colspan and rowspans.
For example, $rows['genre'] instead of just $rows[]. This lets you add the colspan like:
$rows['genre']->$row[$last_row]->$cell['colspan'] = $current++;
Rowspans can be done in the same way, but you can also put a group of values in the same cell.
Module VIEWS version 2
With the free Drupal module VIEWS version 2 you can build very advance and powerful tables: http://drupal.org/project/views
The module VIEWS version 2 is easy to use. You don't need to be a programmer (code aware). Just clicking icons. See by yourself in this video: http://www.masteringdrupal.com/screencast/new-features-in-views2/play
The interesting part starts in the middle of the video.
---
How to contribute to Drupal.