Jump to content

Polls with one question shouldn't have the Number 1


AmericanRev2

Recommended Posts

Posted

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.

Posted

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.

Posted
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.

Posted
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>
			

 

Posted
<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>

 

  • 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...