Check out the LimeSurvey source code on GitHub!

question indent

More
6 years 3 months ago #50769 by gmm37
Dear very helpful forum users,

I am using an edited version of limespired for my survey, and this is definitely the template that I want to use.

The only problem with it is an indent on the first line of each question. I've attached a screenshot to show exactly what I mean.

Is there any way to get rid of this indent? I've looked through the html in the template editor but can't find the right code (I'm very html illiterate).

I'd be really grateful for your help.

Best wishes,

Michał

Please Log in to join the conversation.

More
6 years 3 months ago - 6 years 3 months ago #50770 by gmm37
apologies, the image didn't attach to the last post about the indent.
Last Edit: 6 years 3 months ago by gmm37.

Please Log in to join the conversation.

More
6 years 3 months ago - 6 years 3 months ago #50771 by gmm37
too computer illiterate to attach the image, hopefully this demonstrates how badly i need help!
;)
Last Edit: 6 years 3 months ago by gmm37.

Please Log in to join the conversation.

More
6 years 3 months ago #50772 by holch
The limit for the image upload is 800*800px. That is probably the problem.

Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
6 years 3 months ago #50775 by tpartner
The indent before the question text is caused by the asterisk element that is shown when a question is mandatory.

You can move it to after the question text by modifying question.pstpl and template.css.

In question.pstpl, replace the following:
<span class="asterisk">{QUESTION_MANDATORY}</span>{QUESTION_TEXT}<br />
With:
{QUESTION_TEXT}<span class="asterisk">{QUESTION_MANDATORY}</span><br />

And in template.css, replace:
.asterisk {
  color: #FF0000;
  padding: 0 5px 0 10px;
}
With:
.asterisk {
  color: #FF0000;
  padding: 0 0 0 5px;
}


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.

More
6 years 3 months ago #50776 by holch
@Tony: Do you know how the asterisk is hidden, when no mandatory question? Shouldn't a "display:none" avoid this indent?

Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
6 years 3 months ago #50779 by tpartner
If the question is not mandatory the asterisk is not inserted by quanda.php but the span that contains it remains because it's hard coded in question.pstpl.

So, as in this case, if the span has some padding it will still take up space even though it's empty.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 years 3 months ago #50782 by gmm37
thanks enormously once again, it worked.

best wishes,

michał

Please Log in to join the conversation.

More
6 years 3 months ago #50801 by Mazi
tpartner wrote:

If the question is not mandatory the asterisk is not inserted by quanda.php but the span that contains it remains because it's hard coded in question.pstpl.

Those damn hard coded elements...

Don't you think we should change this?

Will a change affect customized templates or can it be done in a way so that there are no side effects at customized templates?


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 3 months ago #50804 by DenisChenu
Mazi wrote:

tpartner wrote:

If the question is not mandatory the asterisk is not inserted by quanda.php but the span that contains it remains because it's hard coded in question.pstpl.

Those damn hard coded elements...

Don't you think we should change this?

I think the best solution is to use another system of replacment:

Actually: mandatory/non-mandatory
<span class="asterisk">{QUESTION_MANDATORY}</span> => <span class="asterisk">*</span>
<span class="asterisk">{QUESTION_MANDATORY}</span> => <span class="asterisk"></span>

I think it's best to have some optionnal extra option:
{<span class="asterisk">QUESTION_MANDATORY</span>} => <span class="asterisk">*</span>
{<span class="asterisk">QUESTION_MANDATORY</span>} =>

In a specific template for question-help, i use some jquery to remove this div if emty ($('.question-help:empty') selector. But the best is to do in php,

I search for some regexp to do that and put in ls-dev if i found something. (when i have some time)

Another idea ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
6 years 3 months ago #50806 by tpartner

Those damn hard coded elements...Don't you think we should change this?

I am currently going through all shipped templates and moving hard-coded inline styles to CSS files and removing invalid HTML (no small task). These changes will not affect customized templates.

But that isn't the issue here. This is simply a placeholder in the template that takes up space. In my opinion the placeholder is in the wrong position but I didn't design the template and don't feel it's my place to change it's look.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 years 3 months ago - 6 years 3 months ago #50812 by Mazi
Thanks for your feedback!


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
Last Edit: 6 years 3 months ago by Mazi.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form