0

I'm using D7, and I've created the Content Type 'Poll'. That said, I want to add a specific Poll I've created to a published Blog Entry. Is this possible? I thought about creating a poll block, but this would just publish the same poll on all of my Blog Entries? I also can't seem to add a specific Poll field to my Content Type 'Blog'...

1
  • did you try my answer?
    – No Sssweat
    Feb 29, 2016 at 8:42

1 Answer 1

0

You need to install Entity reference module

Then in your blogs content type, add a new field

  • Name: [what ever you like] I named mine aaaa
  • Type: entity reference
  • Widget: auto complete.
  • Then on the settings page for Target Bundle select poll.

Then edit your block, and in entity reference field (aaaa), type your poll name and save changes.


In Views, create a block view of poll.

Under Advanced, RELATIONSHIPS add Entity Reference: Referecing entity NOT referenced.

enter image description here

Checkmark require this relationship.

enter image description here

Then add a CONTEXTUAL FILTER of Content: Nid

For Relationship, select your referecing

Provide default value, Content ID from URL.

enter image description here

Note: your view preview will be blank, but it will show up when you view the blog.

Lastly, in blocks, assign your view block to a region.

Now this will automatically show the poll that you reference in your blog.

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.