By betarobot on
Say if I need to dynamically insert some known node's content at place (table) on a [site page]? How could I do it?
Say if I need to dynamically insert some known node's content at place (table) on a [site page]? How could I do it?
Comments
simple
Also, you can use
node_view($node)for displaying a node.Optionally you can add more parameters to node_load(), it makes loading faster.
For example:
node_load(array("id" => "111", "type" => "story"));Thnks. But...
Why do I get somth. like (sorry I'm not a bigguy in PHP yet):
Parse error: parse error, unexpected '<' in ... dp/modules/page.module(99) : eval()'d code on line 1
???
Cheers,
Andrey
Drupal Sites Showcase. Add yours! | My Blog
you probably included your php into <?php ... ?>
you must not.
then still...
here comes another err:
user error: Unknown column 'n.id' in 'where clause' query: SELECT n.*, u.uid, u.name FROM node n LEFT JOIN users u ON u.uid = n.uid WHERE n.id = '8' AND n.type = 'book' in ........../includes/database.mysql.inc on line 56.
now why?
Cheers,
Andrey
Drupal Sites Showcase. Add yours! | My Blog
it's 'n.nid', not 'n.id' [EOC]
EOC = end of comment
still no result.
But still understand nothing.
I just need to post page (or book page) as this:
html table one cell of which will include whole content (body) of another node [different to node I post].
ok. I just loaded some node [node_load(array("nid" => "8"));], then how to print its content in html table trough php? What code do I have to post exactly?
Can someone be so kind to explain or give an example?
Cheers,
Andrey
Drupal Sites Showcase. Add yours! | My Blog
$theme->node()
You can print the node using
$theme->node($node);where$themeis a global variable (you might have toglobalit depending on the current context/scope) and where$nodeis the object returned bynode_load(). Example (not tested):no result again
...
Cheers,
Andrey
Drupal Sites Showcase. Add yours! | My Blog
just like...
in iframe, but not the whole site, just node body.
Cheers,
Andrey
Drupal Sites Showcase. Add yours! | My Blog