eZ Community » Forums » Setup & design » inline CSS declaration on template
expandshrink

inline CSS declaration on template

inline CSS declaration on template

Monday 17 May 2010 8:17:29 pm - 5 replies

Hi all

I've been looking along forums and I have not found some similar posts but this: http://share.ez.no/forums/setup-design/css-backgrounds, which says you cannot do what I want to.

I'd like to use a background image for every section in my web and every background can be changed by administrator. So I've thought I could make an attribute for my ez class "section" to change by administrator the background image.

I've thought in something like this:

<div id="ejemplo" style="background: url({attribute_view_gui attribute=$node.data_map.background-image});">

What do you think about it?

Monday 17 May 2010 9:17:39 pm

Sure.. Why not? happy.gif Emoticon

Modified on Monday 17 May 2010 9:39:30 pm by HÃ¥vard Bergersen

Monday 17 May 2010 11:12:16 pm

i think it should be possible to do it like that. in fact we have some similar examples. you should take care about absolute or relative paths.

but probably a more elegant solution could be usign ezjscore.

Tuesday 18 May 2010 10:04:11 am

I don't see how ezjscore would help here, but I might be overlooking something.

One way is to create some section class like you say and somewhere in pagelayout fetch the one closest to current node in current path using something like 'parent_node_id', $node.path_array and sorting it by path.

Wednesday 19 May 2010 2:20:16 pm

Hi all

10700 and me got it:

<body id="XXX" style="background: url('/{$PATH.data_map.IMAGE_CLASS.content.original.url}') 0 0 repeat;">

Thanks a lot!

Friday 09 March 2012 11:23:47 pm

Really usefull issue.

Great to work with images with javascript and css, thanks to all!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from