BACKGROUND IMAGE

Where do I exactly apply settings to get the background image properly.for the TopMenu ?
I tried different settings but nothing works. Even the Theme Editor I can only see the fragment of an image at the bottom (while the image is 1920 x 1200 px).

ART

hello Arthur,

there are some applications come with SC that have full page image background applied in the login screen, see the code, planning to use the same soon but didn’t’ try it myself yet

Yeahh I forgot about that. Yes I will check thi out. Thank a lot for reminding.

OK, I went through all sample Apps and see no single Project with the background image, so unfortunately this does not help.

hi
there is
login app in training project
here is the code in M_background php method, added inscriptinit event



/* CSS to put the background in login page */
print ("

 <style type='text/css'>

  body {
    background-repeat: no-repeat;    
    background-image: url(../_lib/img/grp__NM__sc_training.jpg);
    background-position: 50% 0%;
    background-color: #798C9D;
  }

 



 </style>

");

I need this for the MENU App. There is no “onScripInit” event in Menu (don’t understand why?). I tried to place this code in :onApplicationInit" but it’s not working at all.

Hi aka,

If I understand your request correctly.

If you have a top menu, then you enter the background image in the appropriate theme at Menu/Menu/Navigation/iframe

If the image is complex and you want it to seem seamless when displayed, then you will have to spice the “Main” image into two parts. one that fits the number of pixels of the top menu section, and one for the main screen that will be the complete image, minus the portion used in the top menu. This image is then used in the theme settings for grids / forms etc.

Hope that helps

Tony

OK, you’ve mentioned grids/forms. I do not want the image to show on forms or grids. All I need is background image on the Main menu (which is this case to TOP Menu with dropdowns)
The top image can be setup easily in Header. Also - setting it up in THEMES makes it fixed and I want to change it dinamically. For now I can deal with the fixed image for some time though.

aka, why you want to change the image of the menu!? i don’t understand, that is css controlled within the menu css files & theme itself, from layout > css menu… also there is part for menu in the themes, you can add background image for the the rest of the menu parts…

to control it dynamically, I guess will not be possible to use global variables? didn’t try it though

MikeDE - sorry but I do not understand you post. I need a background image on the MENU. Yes I can apply an image in the TOP section (in Layout) but there is no option to apply background image under the menu. This is not unusual request. There are thousands of Apps that use background image. Thses days almost 90% of pgeas is using some kind of background. My request is to use this dynamicaly. I thought I could use several themes for that but I could not find the place to apply a background image to the menu (there is no class for that

I think you should apply the background image property to the element “.scMenuHHeader” instead of “body” (at least for the menu app):


print("
    <style type='text/css'>
        .scMenuHHeader {
            background-repeat: no-repeat;    
            background-image: url(../_lib/img/grp__NM__sc_training.jpg); /* DO NOT forget to change the image url */
            background-position: 50% 0%;
            background-color: #798C9D;
        }
    </style>
");

Giu or aka, can you give example screenshot of the outcome?

The sample scriptcase application Document Library background image, where can I change it? it seems to be hardcoded somewhere, I tried using the code by MikeDE but the background image keep retaining at the “grp__NM__bg__NM__bg_archive.jpg”

Does anyone know how to load the blob (database) image into background-image???

Shouldn’t this be a new question? If you are looking for a full page background image you may have to modify the CSS Theme > Menu > Menu > Page > background image.2020-06-26_06h01_16

If you are looking to pull an image from the database and put it in the menu header:
Read the table on login and set a global variable (need to have the ending tag there; forum wouldn’t let me past the code as is … )
[glo_logo_dark] = ‘<img src="data:image/jpeg;base64,’ . base64_encode( {rs[0][12]} ) . '"

and then on the menu, use the global variable:
2020-06-26_06h05_38

1 Like

Thank you so much i try to configure to menu and test with others application like grid, control and form,
but is is excelente idea.

Best regards