Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6915473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:28:46+00:00 2026-05-27T09:28:46+00:00

I installed and configured the Poll Module to work fine. The website I am

  • 0

I installed and configured the Poll Module to work fine. The website I am working on will have a Poll instance on a page either as a left rail or a right rail item. The Polls would be setup in a separate folder. On the page item there will be a multilist field which will point to the Polls folder and the user can select whichever poll they choose to. The folder will also contain different sublayouts which will could be selected to be displayed on the rail. I have some custom code which will look at the above mentioned multilist field and show these rail items.

I don’t know how to display a Poll programmatically. I haven’t found any code samples and also not sure where to set the sublayout. Should I set it on the Poll template itself and then let use code to display it? How can I achieve this in code? Any code samples would be helpful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:28:46+00:00Added an answer on May 27, 2026 at 9:28 am

    Hoping that you will this time accept the answer, I wrote the following for you (based on the OMS Poll module:

    Read out the field on your item:

     Sitecore.Data.Fields.ReferenceField selectedPoll = (Sitecore.Data.Fields.ReferenceField)Sitecore.Context.Item.Fields["Poll"];
    

    Get the pollItem:

     if (selectedPoll.TargetItem != null)
                {
                    Item pollItem = selectedPoll.TargetItem;
    
                    if (pollItem != null)
                    { 
    

    Check if the poll is opened or closed and place:

     Sitecore.Data.Fields.CheckboxField pollClosed = (Sitecore.Data.Fields.CheckboxField)pollItem.Fields["Closed"];
    
                        if (pollClosed.Checked == false)
                        {
                            // Set the header of the snippetBlock
                            ltPollHeader.Text = pollItem.Name;
    
                            PollVotingSublayout pollSublayout = (PollVotingSublayout)LoadControl("/sitecore modules/Shell/Poll Module/Controls/PollVotingSublayout.ascx");
                            pollSublayout.Attributes.Add("sc_parameters", "PollPath=" + pollItem.Paths.FullPath);
                            pollSublayout.CurrentPoll = (PollItem)pollItem;
                            this.pollRegion.Controls.Add(pollSublayout);
    
                            phPollSnippet.Visible = true;
    
                            int blockPos = 0;
    
                            if (snippetField != null)
                            {
                                if (snippetField.GetItems().Any())
                                {
                                    blockPos = 1;
                                }
                            }
    
                            string cssClass = String.Empty;
    
                            if (blockPos == 0)
                            {
                                cssClass = "snippetColHomeFirst";
                            }
    
                            this.SetClass("snippetColHome", cssClass);
                        }   
    

    Hope that you can make up something using this snippets. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed and configured User Profile module, which allows me to add fields
I have installed/configured Elmah on my personal SharePoint dev environment and everything works great
I have installed and configured SharePoint 2010 to run on the same box as
I have successfully installed and configured msysGit Portable on my flash drive, and have
I have successfully installed & configured the M2E Maven plugin for Eclipse, along with
I've installed the ReCaptcha, configured my public and private key, and everything is fine
I have installed and configured NetBeans 6.7 for c++ according to the official manual:
I have installed and configured MS WebDeploy 2.0 on a (test) server so that
I have installed and configured tomcat+solr on my personal linux machine and windows as
I have django+python+apache2+mod_python installed hosted and working on ubuntu server/ linode VPS. php5 is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.