Ok I have a list of current blogs on a page and what I am trying to do is put little avatar on the side of each blog post. Now I have the code for the avatar but I can not figure out where to put it...... I mean even if i can get something posting on the side of each link would help me at this point:
For example right now im getting this on my page:
Recent blog posts:
Trev's Blog - ( Team Pontiac ) My Take on Season 2 Line Up
BULLRUN II on SPEED: A KICK ASS LINE UP!
Cannonball Heritage?
and what i want is this....
Recent blog posts:
[picture] Trev's Blog - ( Team Pontiac ) My Take on Season 2 Line Up
[picture] BULLRUN II on SPEED: A KICK ASS LINE UP!
[picture] Cannonball Heritage?
So like i said if i can just get a text variable on the side of each link i'll work on the avatar script.... Any Ideas? The code I found that affects the header Recent blog posts is below now there are 2 other files in that folder blog.info and blog.pages.inc....
Below is the code that impliments the block that lists the blogs it is the blog.module file found in modules/blog
* Implementation of hook_block().
*
* Displays the most recent 10 blog titles.
*/
function blog_block($op = 'list', $delta = 0) {
global $user;
if ($op == 'list') {
$block[0]['info'] = t('Recent blog posts');
return $block;
}
else if ($op == 'view') {
if (user_access('access content')) {
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.created FROM {node} n WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created DESC"), 0, 10);
if ($node_title_list = node_title_list($result)) {
$block['content'] = $node_title_list;
$block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.'));
$block['subject'] = t('Recent blog posts');
return $block;
}
}
}
}
Comments
I would recommend overriding
I would recommend overriding the template for blog nodes ('node-blog.tpl.php'):
Have a look here: http://drupal.org/node/190815
--
stevejamesson.com
Steve I read that page
Steve I read that page unfortuantly couldnt find 'node-blog.tpl.php' or did i find it in my server..... hmmmmm
You create it
You have to create node-blog.tpl.php by copying and modifying node.tpl.php.
But don't bother, as it does not address the issue you've raised. You're trying to modify the presentation of a block.
Install Views and create a custom block with a custom template. Do not, DO NOT modify core files, as that is the well-documented Road to Drupal Hell.
ok ive been playing with views
ive actually made a page that is the hotest content on the site with the user avatar whom created the content...... so now i have 2 questions 1. how do i have drupal rezize the avatar for only certain pages and it not affect other places where the avatar is found? and 2nd i could not find anything to do with blogs in field types???? is there a way to creat them?
Theming
In all cases in which you want to resize an image, http://drupal.org/project/imagecache is the answer. However, applying it requires that you learn some more about theming and -- since you specify "certain pages" -- enough PHP to write conditional code.
Make a copy of your
Make a copy of your node.tpl.php file and rename the copy to node-blog.tpl.php. Now all changes your make to the node-blog.tpl.php will affect only blog nodes. The original node-template file will handle the templates for all other node types.
Complete Computer Care