Re: [campsite-support] templates and polls
  • Try {{ pollanswer_edit }}:
    {{ list_polls }}
    {{ $campsite->poll->title }} Question: {{ $campsite->poll->question }}
    {{ list_pollanswers }}

    {{ pollanswer_edit }} {{ $campsite->pollanswer->answer
    }}


    {{ /list_pollanswers }}
    {{ /list_polls }}


    On Mon, Jan 18, 2010 at 8:37 PM, wrote:

    > Author: Terix
    > Link: http://code.campware.org/phorum/read.php?8,8026,8026#msg-8026
    >
    > --------------------------------------------------------------------------------
    >
    > How do i link the polls within the template? I have made two polls and
    > linked them on an article.
    >
    > Then i'm modifying the article template to show the poll, but i feel i'm
    > missing something, and even if i'm reading the manual, i can't make it
    > working...
    >
    > I'm at this point:
    >
    > {{ list_polls }}
    > {{ $campsite->poll->title }} Question: {{ $campsite->poll->question }}
    > {{ list_pollanswers }}
    > {{ $campsite->pollanswer->answer }}
    > {{ /list_pollanswers }}
    > {{ /list_polls }}
    >
    > I'm able to see the polls title and question, but i can't find a way to
    > show the answers and make them working to be chosen.
    >
    > --
    > Sent from Campware Forums
    > http://code.campware.org/phorum
    >
  • 4 Comments sorted by
  • I've done a try,
    this is what i get:

    title Question: this is the first question?



    it seems that the answers doesn't get loaded, but i've made 4 answers on the backend, and the ending date are on 1° of the next month.
  • i've made some progress with this:

    {{ list_polls }}
    {{ $campsite->poll->title }} Question: {{ $campsite->poll->question }}
    {{ list_poll_answers }}

    {{ pollanswer_edit }} {{ $campsite->current_pollanswers_list->current->answer }}


    {{ /list_poll_answers }}
    {{ /list_polls }}

    what i get is this:

    first Question: Which fruit do you like?

    apple


    pear


    banana


    ananas


    second Question: Which meat do you like?

    beaf


    chicken


    pork



    the problem that i have is that i can make only an answer on both the polls.. how do i change the name of the input? and the type? How can i add a submit button? How can i check if all the polls have been answered and eventually stop or accept the submitting?
  • Check this:
    http://code.campware.org/manuals/campsite/3.3/index.php?id=274

    On Tue, Jan 19, 2010 at 6:00 PM, wrote:

    > Author: Terix
    > Link: http://code.campware.org/phorum/read.php?8,8027,8031#msg-8031
    >
    > --------------------------------------------------------------------------------
    >
    > i've made some progress with this:
    >
    > {{ list_polls }}
    > {{ $campsite->poll->title }} Question: {{ $campsite->poll->question }}
    > {{ list_poll_answers }}
    > {{ pollanswer_edit }} {{
    > $campsite->current_pollanswers_list->current->answer }}
    > {{ /list_poll_answers }}
    > {{ /list_polls }}
    >
    > what i get is this:
    >
    > first Question: Which fruit do you like?
    > apple
    > pear
    > banana
    > ananas
    > second Question: Which meat do you like?
    > beaf
    > chicken
    > pork
    >
    > the problem that i have is that i can make only an answer on both the
    > polls.. how do i change the name of the input? and the type? How can i add a
    > submit button? How can i check if all the polls have been answered and
    > eventually stop or accept the submitting?
    >
    >
    > --
    > Sent from Campware Forums
    > http://code.campware.org/phorum
    >
  • Hi mugur,
    i worked with the examples of the manual, but i didn't get anything usefull.. using the code there was a stepback to me ( i didn't get anything using the example on the manual)

    i'm getting some results gragbbing code from the poll_index.tpl inside the template engine directory of the poll plug-in.

    I'm suspecting that maybe the plug-in is not installed correctly? how can i check that, maybe fixing it by hand?

    but i must say that the poll plug-in is working fine on the backend.