I have content type in which I have two or three links .In node.tpl.php, all links are displaying from a single variable "$links" in node.tpl.php. i want to remove one particular link from the "$links" variable by preprocess function and assign that link to a new variables , so i can display it where ever I want.

I created a preprocess function to implement it

function sample_preprocess_node(&$variables){

and I pasted the following code in node.tpl.php

print $create_review; 

It displays "array" in product page and that particular link is not removed from the variable ($links) in node.tpl.php

Can you tell me how to remove the particular link from the "$link " variable in node.tpl.php and display it by another variable in node.tpl.php?

  • ignore this comment
    – keva
    Jul 7, 2011 at 16:00

2 Answers 2


This line will always return true, since you are assigning a value with the '=' operator:


This should be a comparison, so use '==':


Should be

  $variables['create_review'] = theme('links', $create_review);
  • thanks for your answer but product page was not loaded when i replaced the code as per your instruction.Can you tell me what may be the problem?
    – Moorthy
    Jul 8, 2011 at 5:03
  • Reload the page, then check your php error log. What's the last entry?
    – Entendu
    Jul 11, 2011 at 17:26

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.