Jump to content

Polls with one question shouldn't have the Number 1


AmericanRev2

Recommended Posts

You can remove the numbering of questions if you change this:
Open a template: core_global_global/poll
find this code

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$i}. {$question['question']}</span></h3>


and replace with

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$question['question']}</span></h3>

Note: In this case, all questions will not be numbered.

Link to comment
Share on other sites

If this

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$i}. {$question['question']}</span></h3>

replace with

{{if $i>1 }}
<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$i}. {$question['question']}</span></h3>
{{else}}
<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$question['question']}</span></h3>
{{endif}}

All subsequent questions will have correct numbering. The first question will be without a number.

Link to comment
Share on other sites

5 hours ago, Adlago said:

If this


<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$i}. {$question['question']}</span></h3>

replace with


{{if $i>1 }}
<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$i}. {$question['question']}</span></h3>
{{else}}
<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$question['question']}</span></h3>
{{endif}}

All subsequent questions will have correct numbering. The first question will be without a number.

You can wrap the if-clause around just {$i}. so that you don't have to repeat everything else.

Link to comment
Share on other sites

5 hours ago, Meddysong said:

You can wrap the if-clause around just {$i}. so that you don't have to repeat everything else.

Yes, you are right. Thanks.
This works correctly in my test installation.

Template core_global_global/poll

Find

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$i}. {$question['question']}</span></h3>

replace

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{{if $i>1 }}{$i}.{{endif}} {$question['question']}</span></h3>

Template core_global_global/pollForm

Find

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{$i}. {$input->label}</span></h3>
			

replace

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{{if $i>1 }}{$i}.{{endif}} {$input->label}</span></h3>
			

 

Link to comment
Share on other sites

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{{if \count( $collection ) > 1 }}{$i}. {{endif}}{$input->label}</span></h3>

Use that as the replace in pollForm to get exactly what you want. A single question poll will not get any numbers, but multiple questions will.

And this as the replace in "poll"

<h3 class='ipsType_sectionHead'><span class='ipsType_break ipsContained'>{{if \count( $poll->choices ) > 1 }}{$i}. {{endif}}{$question['question']}</span></h3>

 

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...