Background Images Attributes with Concrete5

Permalink
I've created a page attribute called background Image. I created an If > Then > Else statement with inline css so when a background Image attribute exists it populates the css background url . However, instead of using a direct public_html url location I'd like to use the getThemePath so I can use the theme's images folder.

Does anyone know how to modify this code so the url "/images/myImage.jpg" reflects:
<?=$this->getThemePath()?>/images/myImage.jpg


This is the current code:
.backgroundImg::after { background-image:url(<?php if ($f = $c->getAttribute('background_image')) { echo $f ? $f->getRelativePath() : ''; } else { echo "/images/myImage.jpg";} ?>);}

haundavid
 
hutman replied on at Permalink Reply
hutman
You should be able to use this

View::getThemePath();
haundavid replied on at Permalink Reply
haundavid
Thanks for the info. However, with my limited knowledge of php, how do I put that into effect?