I am usig entity reference to nodes that users can decide to hide titles on.
Now i want to print all these nodes from a node--type.tpl.php andexclude user defined node titles.

I am using
$exclude_title_nids=variable_get('exclude_node_title_nid_list', array());

and
if (!in_array($subsection->nid,$exclude_title_nids))

to get this done but this seems a little dirty and not scalable, any best practice recommendations are welcome.

Thank you

Comments

Pieter Maes created an issue. See original summary.

fizk’s picture

Try using this function from exclude_node_title.module:

/**
 * Determines if node should be hidden and user
 * has permission to have the title hidden.
 * @param $node
 *   Can be a node object or integer value (nid)
 * @param $view_mode
 *   View mode, e.g. 'full', 'teaser'...
 * @return
 *   Returns boolean TRUE if should be hidden, FALSE when not
 */
function exclude_node_title($node, $view_mode) {
  return (user_access('use exclude node title') && _exclude_node_title($node, $view_mode));
}
Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)