NetTalk Central

Author Topic: Default background image  (Read 5111 times)

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Default background image
« on: November 13, 2015, 10:34:59 AM »
How to set a default background image for entire application?

Thanks
Walter - SOFTVALE

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: Default background image
« Reply #1 on: November 14, 2015, 08:15:42 AM »
Walter,
You can add the following code to your own custom.css file (create one if you don't have one already). You can override or - as in this example - add properties to the nt-body class which is the one being used by the templates. By doing it this way you can update NT in the future while preserving your changes/additions.

Code: [Select]
.nt-body {
background-image: url("/images/yourbackground.png");
}

Peter

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Default background image
« Reply #2 on: November 16, 2015, 04:50:26 AM »
Hi Peter,

Thanks for you answer.

I want my customer could change de background-image. I have a customer setup table that allow my customers upload the image in order to use it as background-image. So, when it access the page, passing your ID i want to set the background-image with the image that my customer has uploaded.

I'm already getting other information and using them correctly in PageHeader XHTML, but could not change the background image.

Thanks,

Walter - SOFTVALE

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Default background image
« Reply #3 on: November 16, 2015, 08:11:12 PM »
Save the file the user uploads into /images/yourbackground.png

Alternativly write JavaScript to change the image. Something like
 $("body").css("background-image","whatever.png");

which can be added to a page (maybe the header) as
p_web.Script(' $("body").css("background-image","whatever.png");')

Cheers
Bruce

walter.dasilva

  • Sr. Member
  • ****
  • Posts: 314
  • SOFTVALE
    • MSN Messenger - walter@softvale.com.br
    • View Profile
    • SOFTVALE
Re: Default background image
« Reply #4 on: November 17, 2015, 06:08:24 AM »
Hi Bruce,

I tried lots of embed point and no one works.
So i tried this and its working fine.

<style type=text/css>
.nt-body {
background-image: url("<!-- Net:s:global_bgimage -->");
</style>

XTHML of PageHeaderTag

Thanks
Walter - SOFTVALE

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Default background image
« Reply #5 on: December 07, 2015, 04:18:28 AM »
Clarion 10
Nettalk 8.68

Got the background working but decided for now to turn it off.
Have tried everything I can think of including deleteing the custom.css file and it won't go away.
Deleted the image itself and that worked but ....

Brian.
Brian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Default background image
« Reply #6 on: December 07, 2015, 10:45:10 PM »
probably you just need to re-run Gzipall.bat

you can use Firebug to inspect where the CSS is comming from. I'm expecting from all.css, which is created by Gzipall.bat.

cheers
Bruce