implement options, buttons and fixed bg

This commit is contained in:
2022-12-04 16:47:52 +02:00
parent 236d10a768
commit 77a7917869
12 changed files with 118 additions and 9 deletions

View File

@ -9,9 +9,14 @@ module Merged
# background image as inline style
def bg(section)
return "" if section.image.blank?
puts "--#{Image.image_root}/#{section.image}--"
#puts "--#{Image.image_root}/#{section.image}--"
img = asset_url( "#{Image.image_root}/#{section.image}" )
"background-image: url('#{img}');"
style = {"style" => "background-image: url('#{img}');" }
if(section.option("fixed") == "on")
style[:class] = "bg-fixed"
puts "Adding fixed"
end
style
end
# works for with sections and cards that respond to .image