I Created a poll with core module "Poll".

Can we get author of the poll and display in Most recent poll block?

I have using block--poll--recent.tpl.php to theme the poll. I have tried by global user. but how to get a poll of that user??


As every content type polls are node then you can get the creator by get node creator :)

$title:the title of poll

$node = node_load(array('title' => $title, 'type' => 'poll'));

not we have a userId of creator , maybe you need name or anything of it that you can get them by user_load($userId);

  • thanks for reply but.. In block--poll--recent.tpl.php, we can't get node object. So this will not work. – Bhanu Prakash Ryaga Dec 28 '13 at 15:32
  • @BhanuPrakash, yes we can my friend, also you can put it in preprocessor and pass it as variable !!! – Yusef Mohamadi Dec 28 '13 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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