CSS Background-Image within Component

Forum to discuss the new web client version of Servoy.

CSS Background-Image within Component

Postby Gordon McLean » Tue Apr 26, 2016 1:12 pm

Hi

I am trying to add up/over and active images as background-image css to a component. The objective being to use the component in multiple applications. Can anyone advise where the images should be stored ?

I have tried placing it in:

media Folder within solution

media Folder within a sub module of the main solution

placing the image within the component folder and referencing it direct

Cheers
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 253
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: CSS Background-Image within Component

Postby jcompagner » Mon May 02, 2016 10:21 am

if this is really a component thing then i would ship it with the component

But if this is more a styling that the developer/solution needs to be doing then i would say put it in a media folder and reference it through the solution.css

But I got a feeling that it is more pure component internal styling so ship it with the component.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: CSS Background-Image within Component

Postby juan.cristobo » Tue Jun 21, 2016 12:25 pm

In my component template I put this code:
Code: Select all
<img src="ball.png">

And I put the image file into the component folder, but it doesn't show. What is the url for a image in a component? And if the image is in media folder of a solution/module?
Thanks
Juan
Madrid (Spain)

Servoy 7.4.x - MySQL / SQL Server 2008-2016
Windows 10 Pro
juan.cristobo
 
Posts: 186
Joined: Thu Apr 19, 2012 9:12 am

Re: CSS Background-Image within Component

Postby jcompagner » Mon Jul 04, 2016 11:45 am

the component is always in /packagename/componnetname/xxxx

(in the normal structure)

for css you can just have relative urls based on the css location.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 8 guests

cron