NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: walter.dasilva on November 13, 2015, 10:34:59 AM

Title: Default background image
Post by: walter.dasilva on November 13, 2015, 10:34:59 AM
How to set a default background image for entire application?

Thanks
Title: Re: Default background image
Post by: peterH 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
Title: Re: Default background image
Post by: walter.dasilva 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,

Title: Re: Default background image
Post by: Bruce 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
Title: Re: Default background image
Post by: walter.dasilva 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
Title: Re: Default background image
Post by: broche 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.
Title: Re: Default background image
Post by: Bruce 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