Hey,
I have a very simple question on how to best organise content on my page.
I have a list of certain organisations that I will manually add into the site. Each organisation should have its own page. I am thinking of using the CCK module to add fields for the organisation. After the basic information has been added by myself, I would like my users to be able to add further information to the page. Similar to a comment or reply to a forum topic, I suppose. Additionally, I would also like real comments at the bottom of the page.
I have had a quick look at the book module, but that doesn't seem to be what I am after, as it deals with various pages. I suppose what I'm after is very similar to a comment but...I need two lots of comments, if that makes sense? I also need to be able to approve user submissions regarding information about the organisations.
I could code this, but just wondering if there is an easy way to do it and not reinvent the wheel, etc.
Many thanks in advance,
Frederik Grunta
Comments
...
What's the difference between the two kinds of comments? And what kind of "further information" do you want users to be able to add?
I can think of several ways to handle this, depending on what you want. From your brief description, I suggest you create two content types: Organisation (with comments enabled) and "further info" or whatever, then use http://drupal.org/project/cck to add a Node reference field to "further info". (If it works the same way in 6.x as in 5.x you'll need http://drupal.org/project/views to restrict what kind of nodes you can refer to.)
If you do it this way, a user who creates a new "further info" page will get a drop down menu where she must choose which organisation she's writing about. You'll need Views to display (links to) the "further info" pages on the organisation nodes.
Another possibility is to let the users edit the organisation page itself, wiki style. You can lock some fields so that they can't be edited, and only open some of them. If you go that route, you'll probably need some additional modules for getting the workflow right (new revisions waiting for approval while the old revision stays visible). I don't know how to do that offhand, but I've seen other threads discussing solutions for this.
Or if you want your users to just add thumbs up/thumbs down kind of info, a voting module such as http://drupal.org/project/fivestar might do the job. Or, if simple tagging is enough, you might look at http://drupal.org/project/community_tags.
The book module is a navigation tool, by the way. Come to think of it, it would be a lot more understandable if it was renamed to "hierarchical navigation" or something like that. (* wanders off to the issue queue *)
----
Added later:
I had planned to create an issue suggesting changing the name of "book", but I see there are some big changes on the way in #279390: Book module workflow improvements, so I'll postpone that until I have time to look closer at what books are like in 7.x...
Hey zirvap, Thank you very
Hey zirvap,
Thank you very much for your reply :)
The difference between two two kind of comments, is none really. I want to be able to add an organisation and then let users submit stories about their experiences with that organisation. On top of that, I would like users to be able to comment on the entire page. The only difference being really that a comment would be, well a comment. Just something you quickly tap in and submit, while a story submission about the organisation would be a bit more serious. So, theres no difference really. All I need is a text field (and I'd also like to let users choose a 5 star rating).
I like your CCK idea, as that seems to come rather close to what I need but I would like to have
a) the organisation information and subsequent stories on the same page
b) Let users just look up an organisation and then click an "Add story" link rather than having to click Add story somewhere else and then select the organisation.
Any ideas?
Once again, thanks very much.
Frederik Grunta
Sorry to bump this - anyone
Sorry to bump this - anyone have any ideas? I'm a bit stumped :(
Glad to be of help :-)
For a) use Views to create a block with all nodes that refer to the current node. Recipie for 5.x here: http://drupal.org/node/161867 but the user interface for 6.x has been changed (and is vastly more user friendly, from what I hear), so it may not be all that useful.
Then you need to specify that this block shall be shown on all pages of Organisation type. I found this snippet: http://drupal.org/node/134425 and did the following to show a block on content type "komiteoppgave" in 5.x, don't know if it works for 6.x:
For b), I tried searching a bit, and found a forum post asking for the same thing but not getting any answers :-( (http://drupal.org/node/115763) and another thread which asked for something related but rather more complicated which may be useful: http://drupal.org/node/161116. Searching in the contrib modules section, I found http://drupal.org/project/computed_field, which perhaps is the most hopeful path. If you don't get it to work, I suggest you post a new thread asking specifically about that problem -- then you have a better chance of finding someone who can help you.
If you do find out how to do it, please consider writing a handbook page about it. It sounds like something that many people would find useful!
:-)
It worked!!
Thanks!
How I ended up doing it, in case anyone else ever stumbles on this: (mostly copied from other pages, but hopefully it saves someone else a few hours)
I created a content type for my organisation. Then I created a content type for the stories about the organisation. Then I added a Node reference field to the story content type.
From here, I created a new view:
Relationships: Selected Node Reference field
Arguments: Node nid, then in the relationships dropdown, selected field nodereference
Fields: The information I wanted to see (title, body, etc)
Sort Criteria: Sorted by node post date
Then added a header and other presentational settings.
Next, I copied my node.tpl.php from my themes directory, pasted it back in and renamed it to node-[[content type]].tpl.php, where [[content type]] was the name of my content type.
Then, in this new file I added:
Replacing [[view name]] with the name of my view name. This will show the view only on pages of the selected content type.
I wasn't able to use a block, as it appears that blocks can't accept arguments.
Once again many thanks for your help :)
*EDIT*
Fixed problems with angle brackets and a couple of typos
If you have some familiarity
If you have some familiarity with theming and php then you can achieve what you need exactly.
Go with the CCK route. Make the organization type. Make the 'my story about an organization' type. Put a node reference field in the 'story' type to reference organization types. So far so good right ( just as explained above)?
Now just make a node template for the organization type. Use php to grab all the 'story' types that point at the particular organization being displayed. Load and style each of those 'story' types and display them after the content for the organization being displayed.
Now just enable comments on the organization type and you have what you want.
The organization will be displayed like so: