Hello
I am in the process to convert a mmorpg homepage to drupal.
All is going nice so far, but now i think i hit a system limitation of Drupal compared to the "standard class" CMS like Joomla, Zikula and other.
This limitation is related to "bind comments (or other core features) to dynamic pages or external data".
There are some threads related to this topic:
http://drupal.org/node/212979
http://drupal.org/node/229157
http://drupal.org/node/204801
http://drupal.org/node/112983
Let me explain what it means:
In short word, when i understand right, drupal is defining "content" as "base type" node. When drupal is loading
up, it calls a row of hooks which calls and binds their core and modules to that content. Content are identified
by its node ID, which is presented usualy by an unique integer. That node content can be defined in nearly any way, but i has to be part of of the drupal data base and must be stored there in the node db part.
Lets call this behaviour "early binding" when it comes to comments, rating or other things you enable (bind) to
content.
Now, here is the problem. Because there is of course other "forms" of content.
For us, as mmorpg, we have a big data base of any kind of content. Items, players, quests... They all are of
course not organized as nodes or any drupal native content and doing it is no option in any way.
So, can drupal manage "non native content"? All what i read about so far only explains how drupal can manage
their native node content.
Other content can of course be many stuff. Like dynamic data. For example, i want a mathematical website,
analyzing a complex function and their behaviour.
Now i creating a module like this:
.../?q=mathe&a=1&b=2&c=3
Module mathe itself is feeding a function like a^2*b^a+c*b (no idea thats senseful, think its the one from the
basic chaos theory ) with a,b and c and then it produce a graphical chart out of the function, some statistics and other interesting stuff.
Lets say this is one of the functions, where 99.9% of the values of a,b and c are uninteresting, but a few make
sense. That we want find, talk about and so on. For the chaos theory we want for the unique values the "runs quick to infinity or not" for example.
Now, we write the module, doing all that presentation stuff related to that URL.
Note, that we don't have stored now ANY content data. But we HAVE content to show. Unique, mathematical content. I did this example to point out we don't have to deal always with a database for the content. The
problem with external content is the same. Think about a site about weather, using and analyzing real time
weather data. The data itself is dynamic, but for example the geographical position is not. Lets say we
feed the URL with geographical information. Its unqiue again but we don't want create for every possible longitute
of the earth a node, or?
The problem is, again, that we don't want or can store the pages as node content. That makes no sense or is physically impossible for some content. But we want bind rating, comments or even forum threads to the unique pages, which are defined by the data query string, which is our unique identifier (or the tag is build out of it OR the module generates for "valid" input a valid hook tag).
To point it out: In nearly every other CMS, that is no problem and you can find out in minutes how to do it.
In Zikula (formerly postnuke) you simply mark a module as "enable the comment hook". Then you
go to the base theme and you feed a smarty tag with the URL as unique identifier for the comment.
Or you bind the comments directly to the module, feed the comments identifaction tags (so comments
knows to which page and/or content it belongs). Thats very powerful, because you can compose for
example out of the url module & tags a more generic tag which then bind a comment thread to different
pages but which are about the same thing, so you use the same comment thread.
Lets name this "late binding" of the comments.
Now, the simple question: Can drupal doing late binding or mimic that behaviour of standard CMS? To non node content?
So far i don't found any positive answer in the forum or the docs. Let me point out that i found it a bit strange, that this standard behaviour of content managment is not described anywhere on first hand for drupal.
One last thing: Please don't get upset when i write about "drupal limitations". I don't flame about drupal. I am aware about that every system have its strength and limits. In its base behaviour drupal it is superior to Joomla and Zikula, i can ensure it and thats the reason why i want move our webpage to drupal.
Comments
Content can come from a lot of sources
Drupal have a lot to offer for a lot of situations. A most user will be able to use Drupal within it's own limits, other developers will create web sites that are far from looking as a Drupal site and once you start thinking like those developers, well, you find Drupal limitless.
With Drupal you can query any number of database you would with the proper queries. In fact, Drupal can be set up to use any number of databases.
But let's look at a showcase: Stumble Safely (http://www.outsideindc.com/stumblesafely). This web site uses data from 6 public sources.
For more information:
http://www.developmentseed.org/blog/2008/nov/12/stumble-safely-launched-...
To quote someone here: "This is awesome".
/*_*/
http://www.xmacinfo.com
Sorry, no offence, but i
Sorry, no offence, but i have to point it out: I gave with the mathematical function example a explicit functionality example and how it is solved in a joomla/Zikula class cms. I can even post the needed code here using their standard blank module, its only half a dozen lines of code + 2-3 clicks. It works with all hookable modules there, i can for example bind shop items to infinity possible pages in the same way. Ratings, votes... all what you can imagine, without creating any DB entry (except you vote/rate/comment - then that db item for that action itself is created as usual of course).
So far i can see thats simply not possible in Drupal. You have to use at last a dummy node for every page.
Which would make it impossible to build up the standard core functionality on virtual pages or external data
which naturally have no node.
So, IS that a drupal limitation and how its solvable?
I think you may have a
I think you may have a point!
Drupal is very node-centric, as you have seen - and there are contrib modules to turn users into nodes, comments into nodes ... There may be something out there that will help with attaching comments to a particular URL - I've not looked, but I were to roll a (smallish) custom module to handle this I'd probably approach it this way. It's not going to be as easy as Joomla/Zikula, but may not be *too* hard either.
Comments want to be attached to nodes and from looking at the DB schema there's not an obvious alternative, so let's run with that. But let's create the node associated with a particular "page"/URL on the fly, so that we don't have redundant nodes floating around. However we want to be able to Add new comment even when the relevant node doesn't yet exist -> use an empty dummy node for pages/paths which don't yet have their own.
Then when the new (first) comment is submitted, use http://api.drupal.org/api/function/hook_comment/6 ($op == insert' or possibly 'validate') to create the relevant node and also modify the comment to point to the new node instead of the dummy. The new node could have a CCK textfield which ties it to the URL perhaps.
You can create the node with http://api.drupal.org/api/function/node_save/6 (possibly an empty object of stdClass would work, tho' you may need to set $node->title). $node->nid will be populated for you so you can then modify the comment.
To get the relevant node to display at the bottom of your module's dymanic pages (well we want the node to be empty really and just want the comments to display ... I can't remember offhand if Drupal lets you have empty title for the node but you could inhibit display if necessary ... you could maybe even use the title to hold the unique ID instead of using a CCK field) you could use a View which used the relevant bit of the URL/path as a Views argument which is used to pick out the node with the matching CCK field (or title). Then just stick this View in a block in a custom region at the bottom of the page, or you could invoke the View directly from your own module. Or you could code this whole bit by hand (probably requires about 1 query).
I hope this is clear-ish and that I've understood the problem correctly ... I've not used the Joomla and I have a feeling that Drupal "modules" are conceptually different from Joomla modules, so there's always a chance I'm slightly at cross-purposes.
Anyway sounds like we need a feature request for core...
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Yeah, i also checked last
Yeah, i also checked last night the db structure and read about it.
It seems a common problem and i am a bit stunned it is not solved yet.
Other modules even implement their own comment systems for their non node content (gallerix).
I asking for another reason too.
I included wikkawiki ( http://wikkawiki.org ) as drupal module.
Native called from drupal over a normal module which calls with a "include_once()" the wikka index.php
and delivers the content. Wikka is installed standalone in a sub folder to drupal and then an easy 17kb
patch is done over it. Changed is not much, just their user & session handling is disabled.
All other stuff is done by URL magic.
Works like a charm. User with write access to the module are automatically transfered in the wikka db. All extensions
works, The DB can be used at any time as standalone... Its not a bridge system, its a shared user/session DB.
It fits also fine in the drupal theme engine. Even old wikka content or DBs can be used.
I did the same for Zikula and because i used the (unique) wikka URLs + module name (module name = sub folder name of the wikka installation) it was easily to attach all hook stuff to the module. For the CMS, the wikka output is just the
normal generated native module output.
In Drupal the hook part does not work atm, because in the current state it can't handle non node content in that way.
And it would be senseless to transfer that content to drupal node content.
The solution is normally simple, because it is used in that way in most other CMS:
We add a string tag element to the comments table. Which is used by a late bind handler. Which is nothing more
as an explicit php function, calling the comments module somewhere in the code with a $tag argument instead of the $nid. That can be module code but also the theme itself (but i have no idea where there are the engine limits, where we miss then important stuff). Thats all.
The comments can be normal handled, just the re-link code must check there is a $tag too, and then use that as url generator instead the node.
It is a very common way to handle this class of features. And comments is also in drupal used in that way, itself done as non node module. Just the node integer as tag is fixing it on nodes.
Pretty strange idea, even i see the strength of a generalized content in one table and one base format.
Yes.
Yes.
As in, I think I agree with you, as far as I understand what you're saying. Basically that Drupal could do with a new binding framework. Like all these things it just requires someone with sufficient expertise (especially of the core architecture) and motivation to code it up.. I guess that nodes have worked so well that the need hasn't been great enough to date.
As far as this thread goes, where are we up to?
1. It sounds like a core feature request would be a "good thing". I don't have the insight (nor the long-term motivation) to champion this. Would you care to open a new issue/feature request?
2. In terms of adding comments in the situation you described, does the suggestion above help? No transfer of PHP generated or externally sourced/stored content to Drupal nodes is required (all that happens is a node is created to act 1. as an anchor for the comments and 2. to store the fingerprint ($tag)).
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
This would be a useful feature
I am facing the same limitation in another context. Don't want to create thousands of new nodes, but still need to be able to comment / annotate on dynamic content.
Max
>need to be able to comment
>need to be able to comment / annotate on dynamic content.
Well the comments need to be bound to something, At present, the node is the something that Drupal provides by default that lets you do this ...
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
I agree with this as well,
I agree with this as well, not so much on dynamic content, but even on the file system layer. if a node is a gallery with multiple pictures or audio files, there's no way to comment on them individually, you can comment on the gallery but not the images, unless you create them each as nodes.
Sounds like a feature
Sounds like a feature request http://drupal.org/node/add/project-issue/drupal/feature is still in order ... :)
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
Joomla and Drupal
It will be great for guys planning to use CMS system if a comparative chart for Jommla and Drupal is published. Only experts who have worked on both CMS can do justice. I believe going by the thread content, one of you can do this. If this kind of data is already available, we would love to look at them immediately - RR