Using nodes
Hi,
First of all thank you for these great videos.
I feel more prepared than ever now, to work with Drupal and build a module.
If I may make a video request though, it would be a generel introduction to Drupal, its admin interface and the build in functionality.
So I'm starting to write my own module and will do it the DB way.
But I'm wondering - wouldn't it be more logical to add entries as nodes? This way they will be included in searches as well automaticly and as I understand it, everything in Drupal is based on nodes?
--
Morten
Hi there!
Great request for introductory videos, I'll be keeping this in mind.
As far as how you store your data, you make some good points about saving the data as nodes. You get to leverage the node system for working with and extending the data, as well as integrating with other modules like Search. There's also a lot less work when it comes to integrating with Views. If you're not sure which way to go, I would suggest beginning with nodes and working with some sample data to see if you can get what you need.
Cheers!
Chris
Hi Chris
I'm sure nodes are the way to go.
One question though, which I'm sure you would answer in a maybe future video series.
How do I use Drupal?
I've seen all you Drupal 7 core videos now - and this time I haven't forgot any of them :)
I've read All the Geting startet pages on Drupal.org, I've dug into the documentation pages of Drupal.org, I've played with the popular moduler like views, ctools, pathauto, wysiwyg etc.
If I use nodes, which we have etstablished is the way to do it in most cases, then how do I setup my pages? (the best practice way?)
Is it normal to create my own *.tpl.php files in my theme for different kinds of nodes, listings etc?
Because for what i have experienced so far by playing with Drupal, I cannot "design" my nodes through the Drupal interface. I can arrange the content, like selecting that body should be sjosk before or after some of my costum fields. But if I where to place the content of to custom fields next to each other, I would need to write my own template for that. Right?
Manu newspapers here in Denmark have startet to use Drupal now. But when I take a look at their pages I imagin that they most have made their own templates to all of their node types?
Is this correct? Or would I to this in the interface somehow?
And once again - thank you for the work you have put into your videos. I'll recommend this whitout any seconds thoughts.
Great questions!
To address your more specific question about how to lay out nodes, I should have videos to tackle this in the future, but for now let me see if I can point you in the right direction.
Using different template files for different content types is definitely normal. In combination with preprocessing functions, you should be able to get anything you need that way.
I've also had some great experiences using the Display Suite module along with straight up CSS. Display Suite can give you basic layouts for nodes like a 3-column layout with a header and footer, through simple settings in the "Display settings" area of a content type. From there, you can use CSS and field ordering to get what you need. You can then use preprocessing functions when you need to alter the actual content before it gets sent to the template. I haven't used the Custom Formatters module for Drupal 7 yet, but for Drupal 6 at least it provides a way to add reusable field formatters.
Let me know if this points you in the right direction.
Cheers!
Chris
Thank you Chris,
I anticipated that this would be the normal way of doing it.
But to share my projects with future developers I find important to do it right the first time. And since I'll be working alone for some time, it's better to have asked one question to many, instead of creating my own way of doing things.
And Display Suite sounds interesting, I'll defiantly take a closer look to that.
Thank you for your time :)
My pleasure, good luck!
I see chapter 11 actually tells about using nodes and theming them, so maybe I should just start by viewing this chapter again.