I run a television news site using ExpressionEngine as our CMS. At times we have web polls that are related to specific posted news stories. Currently I am using polldaddy to do that but have recently purchased LGPolls and am attempting to integrate it into our news production.
I have figured out how to display the latest LG Web Poll entry on our home page… but I have not figured out how to “relate” a specific web poll in the system to a specific news story.
In the New Article Publish Form I have a field named “art_poll” that is related to the weblog where I keep my LG Polls (lg_polls).
If an article has a related web poll, the reporter selects the appropriate web poll in the “art_poll” field of the Publish Form and the news article and the selected web poll are now related.
Once that is done - in my article template I can pull any of the LG Web Poll data by using a relationship tag… I can pull the related poll’s {entry_id} or the {poll_question} or any of the other parameters… but I am unable to understand how to code my article template to display the selected web poll… which may or may not be the latest web poll in the system.
I’m using the code below as a basis:
{exp:weblog:entries weblog="lg_polls" show_future_entries="yes" show_expired="yes" limit="1" dynamic="off"}
{embed="modules/.polls_poll"
entry_id="{entry_id}"
poll_question="{poll_question}"
entry_date="{entry_date format='%Y-%m-%d'}"
expiration_date="{expiration_date format='%Y-%m-%d'}"
ajax_return="modules/polls_ajax/{entry_id}"
return=""
}
{/exp:weblog:entries}
I can manually place the specific web poll’s entry_id into the two places where code above calls for it and get the specific web poll’s possible answers but the latest web poll’s question… and if voted on - I will get the specific web poll’s results but the latest web poll’s question.
I have created a “forum_example” page that may help explain things… it is here: http://www.panhandleparade.com/index.php/web_poll/forum_example/
Any help you might be able to offer would be gratefully accepted…