Question

I have just noticed that when viewing an individual node, that the seems to be Image:, Content: and Tags: embedded as a result from the render function. Does any one know how to remove these? (Google turns up nothing, like most Drupal questions)

Regards

EDIT:

Lets say I have a page which loads in taxonomy nodes into a carousel. If I view the page It looks pretty much as intended. If I view each of the nodes individualy /taxonomy/node it appears as:

Image: [the images] Content: [the content] Tags: [list of tags]

Same goes if instead of the previous page loading the nodes as they currently do and I do it like so:

$ids = taxonomy_select_nodes(array(1));
$professional_nodes = node_load_multiple($ids);
foreach( $professional_nodes as $view ) {
    echo '<li>' . drupal_render(node_view($view) ) . '</li>';
}

I get the same outcome.

Was it helpful?

Solution

There are several ways to do that, here is a quick solution

Try to print the teaser version of the nodes, and customize the appearance of the teaser from manage display page admin/structure/types/manage/page/display/teaser.

You will just need to add teaser as a second argument to node_view to print the teaser version.

$ids = taxonomy_select_nodes(array(1));
$professional_nodes = node_load_multiple($ids);
foreach( $professional_nodes as $view ) {
    echo '<li>' . drupal_render(node_view($view, "teaser")) . '</li>'; // the edited line.
}

Hope this works... Muhammad.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top