0

Is there a way to exclude titles in bulk? I want to exclude title of several nodes all at once.

I'm using Exclude Node Title to remove node titles to the display. However, I can only edit it one by one by opening and editing each nodes.

What I want is to update nodes by bulk if possible.

Thanks!

2
  • What do you mean by excluding them? Would you explain little more. What are you trying to achieve exactly?
    – W.M.
    Commented Apr 4, 2016 at 3:59
  • I'm using Exclude Node Title to remove node titles to the display. However, I can only edit it one by one by opening and editing each nodes. What I want is to update nodes by bulk if possible.
    – japhfortin
    Commented Apr 4, 2016 at 4:55

4 Answers 4

0

override the node template and remove title from there.

1
  • I'm sorry sir. I don't want to remove the title completely. I just want to remove the title to some selected nodes. I'm using Exclude node title module to do this. But, it's done one by one to each nodes. What I want is to do this by mass or by bulk. Just what view bulk operations module does.. Thanks!
    – japhfortin
    Commented Apr 4, 2016 at 5:44
0

What @Mohammad AlQanneh means is the following:

a. Go to your theme / subtheme directory

b. create a file named node--MACHINE-NAME-OF-CONTENT-TYPE.tpl.php (example node--article.tpl.php) and paste the contents of the original node.tpl.php inside it

c. edit the file and remove the HTML / PHP code that prints the title, for example, remove or comment out this:

<a href="<?php print $node_url; ?>"><?php print $title; ?></a>

d. clear the caches, that is all.

1
  • No sir. I don't mean to remove all node titles to all nodes. "Exclude node title" module allows title to be removed to the user selected nodes. But as what I've observed. I can just do it one by one to each page. What I want is a way to select multiple nodes and execute what "exclude node title" does. This may seem to be a VBO (view bulk operation) related functionality, if you're familiar. Btw, I appreciate it. Thanks for responding.
    – japhfortin
    Commented Apr 4, 2016 at 5:40
0

Hope this solves your problem

function theme_preprocess_page(&$vars) {
  if ($vars['node']->nid == 'your node id' && $vars['node']->type == 'your-content-type') {
    unset($vars['node']->title);
  } 
}

Add this code in your template.php and clear the cache

0

Now I understand well what you need and here is the way to do it:

a. create a custom Integer field called field_show_title with two possible values 1 or 0

b. use VBO to bulk update the desired nodes to set the custom field's value to 1 or 0

c. in the node--???.tpl.php file use PHP's if or switch & case statements to determine if the title should be shown or not based on the value of field_show_title

1
  • Thanks for the input sir.. But, for now, I want to know if exclude node title module has this functionality, because if there's not, I will resort to what you've said. Thanks!
    – japhfortin
    Commented Apr 5, 2016 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.