Posted by douggough@drupal.org on September 16, 2006 at 9:28pm
I've been looking at view_nodes.inc, and I think I understand the concept, but I'm not sure how to add a field type to it. I want to be able to choose the nid of a node as a displayed field. Right now I can choose things like node: Title, node: created time, node: updated time, etc. I want to add node: nid to that list, because I need to display a list of node titles and nids of nodes belonging to a certain category by executing a view.
Comments
Better leave the core alone...
Servus.
Almost everything you want to accomplish (as long you don't need new fields in the database) you should achieve through theming. There's plenty of examples and how-tos in the handbook and the forum... If you're going to tweak the core the next update will become a special case for you.
Norbert
-- form follows function
Norbert
-- form follows function
Is the views module considered core?
I didn't know that the views module was core. I'm pretty sure I downloaded it and installed it myself.
I ran the Microsoft Malicious Software Removal tool, but Internet Explorer is still installed on my computer.
Doug Gough
313 Web Development Studio
Views isn't Drupal core
Servus.
You're right, Views isn't Drupal core, but "core" isn't a Drupal only thing... However, hacking the code of somebody else (even Drupal core) is always a bad idea if you want to be able to upgrade painlessly. However, making it a different project (by renaming it) should keep you on the safe(r) side. From your description I thought it would make more sense to use the established theming standards anyway.
Once you're happy with the "add-on", you may as well do a module on your own, as a plug-in to Views. I think this would be the best way to deal with this issue.
Norbert
-- form follows function
Norbert
-- form follows function
I'm looking at using a theming method instead
Since all I'm trying to do is get a list of the nodes created by aggregator2 module, with thier nid listed along with the title, body etc, I'm sure theming is a better route. I'm not sure how to procede though. I looked at the theme wizard for views, and used it to create a theme for my view, but I'm unsure how to include the nid in my theme. Is there a way to add the field for nid to my view theme if it's not there as part of the data set that the view is getting from the database? Or am I looking in the wrong place altogether?
I ran the Microsoft Malicious Software Removal tool, but Internet Explorer is still installed on my computer.
Doug Gough
313 Web Development Studio
Why not using a "proper" view?
Servus.
I had the same problem myself for a while. Then I understood the "views" idea -- make lists of nodes they way you want them. So if you got a view with an "unrelated node" remaining, why not building a view which retrieves that node as well?
You can even "glue" nodes using taxonomy. I don't know about aggregator module, so you're on your own if it comes to figure how things could be done, but in general I'd think it should work without too much coding anyway.
Norbert
-- form follows function
Norbert
-- form follows function
My users are enslaved
My users are enslaved by Macromedia Contribute, and refuse to be set free. I almost had a rebellion on my hands when I tried to take it away. So I'm trying to find a way for them to include existing drupal content by using the attached node module, and putting the tag
[node:nid]in the body of thier Contribute document. I use a customized module to import the Contribute document into the Drupal system, so when it displays inside Drupal, the attached node tag works as expected, and the attached node is displayed. That's why I need to display the nid in big numbers next to the title of the node, but only when the Existing Content For Reference (or some name like that) view is executed. It makes it easy for my users to get a list of all available content and match the article they want included in thier Contribute document with the article's nid. If I could use a view, and pass it parameters in the same way I'm trying to use attached node, that would be cool too. Is there a way to reference a particular view using a tag like[view:name|parameters]? If so, it would be easy for me to create some really simple way that the users could type it in to Contribute (something like [calendar:middleschool:grade 7 hiking trip] to reference an existing calendar item, for instance) and have the import module remove that and replace it with the correct view arguments, or something like that.I ran the Microsoft Malicious Software Removal tool, but Internet Explorer is still installed on my computer.
Doug Gough
313 Web Development Studio