By hprashi on
I have an array containing the nid(node ID)... how to list the teasers of these items?
is there a function something like print_node_teaser($nid) which i can use to print the teasers??
I dont want to use views....
I have an array containing the nid(node ID)... how to list the teasers of these items?
is there a function something like print_node_teaser($nid) which i can use to print the teasers??
I dont want to use views....
Comments
have a look on
have a look on http://api.drupal.org/.
Maybe it is this one : http://api.drupal.org/api/5/function/node_teaser
Easy
node_view(node_load($node->nid), $teaser, $page, $links);where $teaser (TRUE/FALSE) is whether you want a teaser view; $page (TRUE/FALSE) is whether you want to display it on a stand alone page; $links is whether or not to add links (such as "read more"). Only the node is required.NOTE: There is a bug in the node module that you may need to fix. Check the issue status.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
i couldn't understand the
i couldn't understand the discussion fully....
but i was able to get a teaser view....
i just copied the contents of the function node_view() into a page and supplied the argument variables ($node,$teaser,$page,$links) .... i got a teaser view... but the problem with this is hook_nodeapi($op='view') wont be called.... (so wont be able to use this method... as i am using a module which hooks at $op=view)
if u can, can u please tell me how exactly to proceed to get the teaser view with hook_nodeapi() working?
hey nancy, thank you for
hey nancy,
thank you for your help... it worked! :)
i did not use any patch... i create a new module and a menu there and used the code you gave
it worked!
It was not working when i tried last time was because i was using this code inside a page(content-type) with php filter... there i was getting a teaser view... but hooks from other modules were not implementing...
thanks a lot for the help...
Hmm...
Hook_nodeapi should have been triggered even with the code in a page - I've done this.
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
hey it worked. Reallised my
hey it worked. Reallised my mistake...
I was giving
instead of
thanks for the help... really appreciate it :)