By ArgentOfChange on
Howdy,
I just wanted to check if I completely understood what was said here: http://www.developmentseed.org/blog/2007/oct/30/pick-it-feed-stick-it-node
The specifics:
I created a content type called "programmes" which is basically info about several course offerings. To make it easy for the authors, I used CCK fields for (1) programme logo (2) introduction (3) links (4) more info.
I was asked to incorporate the feed from each programme blog right before (4) to show maybe three or four blog teasers.
From what I've seen in the screencast it seems possible to add another CCK field to my "programmes" content type that would insert the appropriate feed element - n'cest pas?
Cheers and thanks!
Comments
Ok, that was a pretty dumb way of going about it :P
What I intended was to stick a block with RSS feed teasers into the middle of a page that was created with CCK fields.
It's pretty easy to get the block to display either below or above the content:
(1) create new region (2) specify it in page.tpl.php (3) assign the block to that region and voila!
However, what if you need that block right between the content from field_intro and field_content?
What if there were a LOT of fields and you needed to stick a block between two groups of fields, group_introduction and group_content?
I found this: http://jodyhamilton.net/node-theming-field-deconstructing-node-content-d...
as well as this: http://www.nicklewis.org/node/846
With regards to the group of fields, do I just do
<?php print $node->content['group_introduction']['#value']; ?>in my node.tpl.php?Basically you're on the
Basically you're on the right track, you need to print each field individually - then you can print the block or a view directly into the node template precisely where you want it.
That first article you linked to has some interesting points, the way she is doing that is quite helpful especially for printing the teaser and body fields, for others you might end up with code like this, which is strait out of one of my sites (its a CCK user reference field):
There's quite a lot of info on theming for CKK and its various field types, embedding Views, printing blocks etc in the handbooks and forum, just search around for it. Devel module can be handy or your bestest friend...
print_r($node)Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Yeah, I had a eureka moment
Yeah, I had a eureka moment when I saw her post. So I tried putting this in my node.tpl.php:
But as you may have guessed - it didn't work :(
I've looked around the Drupal site for the better part of today and one thing I learned was that there were so many ways of achieving this. However, since I don't know any PHP I was looking for something as simple as (1)define region (2)specify $content fields (3) insert region between content fields - in short the correct way of implementing the above.
Like i said, I'm hampered by my lack of PHP knowledge, so if you can kindly point me in the direction of the handbook that teaches how to split up CCK field-based output of content, I'd be much obliged!
OH MY GOSH. This is what I was looking for.
http://drupal.org/project/viewfield
"Nodes hold content. Views save queries. Wouldn't be great if a node could hold a saved query? Now it can. Viewfield is a CCK field module that allows administrators to put views directly into nodes. When creating a node, users can select from a list of views. When the node is displayed, the view is run and the content is inserted into the body of the node."