Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

CSS background images not displaying from custom template

More
8 years 2 months ago #131668 by hano
Hi,
I'm developing a custom template (at upload/templates/tsr) but I can't get images to display as background images in css. The images are located at upload/templates/tsr/images/ and the css at upload/templates/tsr/css/template.css.

When I do this:
Code:
<button type="submit" id="movenextbtn" value="movenext" name="movenext" accesskey="n" class="submit imgbtn" style="background-image: url({TEMPLATEURL}images/continuebtn.png">continue</button>
The image displays.

When I do this:
Code:
<button type="submit" id="movenextbtn" value="movenext" name="movenext" accesskey="n" class="submit imgbtn2">continue</button>

with the following in template.css:
Code:
.imgbtn2 {
    background-image:url(../images/continuebtn.png);
}
It doesn't display. If I navigate to the url it's trying to get the image from I get:

404 Not found.
Unable to resolve the request "tmp/assets/images/continuebtn.png".
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.


Am I putting the image in the wrong place?

Thanks
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 months ago - 8 years 2 months ago #131669 by DenisChenu
Hi, yes, can confirm the issue.

And cannot be fixed actually.

myself wrote: Corrected :
Can be fixed with debug=>1
See : github.com/LimeSurvey/LimeSurvey/blob/ma...ents_helper.php#L175


Please : report the bug in our mantis

PS: assets url is done on complete css file, this must be a global asset url and assets is done with:
assetUrl= template/asset/

css link $asseturl/csslink

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 8 years 2 months ago by DenisChenu.
The topic has been locked.
More
8 years 2 months ago - 8 years 2 months ago #131678 by hano
Thanks for your reply.

I got it to work by adding this to config.php
Code:
'config'=>array(
    'debug'=>1,
    'debugsql'=>0, // Set this to 1 to enanble sql logging, only active when debug = 2
      'assetManager' => array(
          'baseUrl' => 'templates/tsr/',
          'basePath'=> dirname(dirname(dirname(__FILE__))).DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'tsr'
      ),
  )
:)
Last edit: 8 years 2 months ago by hano. Reason: I said my config change didn't work. But that was due to a permissions issue with my config file.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 months ago - 8 years 2 months ago #131692 by DenisChenu
Corrected :
Can be fixed with debug=>1
See : github.com/LimeSurvey/LimeSurvey/blob/ma...ents_helper.php#L175

.............

Hi,
Here : you set the global path for all assets to your template ?
And it work ?

You have a lot of new directory then in your template ?

:ohmy:

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 8 years 2 months ago by DenisChenu.
The topic has been locked.
More
8 years 2 months ago #131794 by hano
Hi
Yes I set the global path for all assets to my template and it works.
No, I haven't got any extra directories in my template. Only the standard css/, fonts/, images/, scripts/ and views/.
My template is 100% custom, though so I don't need assets from elsewhere.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 months ago #131797 by DenisChenu
Hi,

I corrected my answer : set debug to 1 fix the issue :).

There are a bug in LS core here .

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 1 month ago #131841 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose