not working

Permalink 1 user found helpful
I've followed the online instructions to add a custom theme, but when I view source, the links to the images and CSS are not picking up the themepath code.

Source:
background-image: url(<?PHP $this->getThemePath()?>images/bg.jpg);


Genreated source:
background-image: url(images/bg.jpg);


I also tried:
background-image: url(<?$this->getThemePath()?>images/bg.jpg);


and got this generated:
background-image: url(<?$this->getThemePath()?>images/bg.jpg);


Can anymore shed any light for me please?

For info,
<?php Loader::element('header_required'); ?>
worked fine as it shows the edit header OK.

zapbrannigan1972
 
citytech2 replied on at Permalink Reply
citytech2
Are you trying to put this code into the css file?

Citytech
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
Hi Citytech,

No, the code is in the default.php file.
citytech2 replied on at Permalink Best Answer Reply
citytech2
The code should be like this.

<?php echo $this->getThemePath()?>/


You have forgotten to put the "echo" as well as trailing slashes.

Citytech
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
FIXED! Brilliant. Thankyou.

I guess someone needs to update this page then!?

http://www.concrete5.org/documentation/how-tos/designers/make-a-the...

Thanks again
citytech2 replied on at Permalink Reply
citytech2
I don't think that the code was wrong there. The code was
<?=$this->getThemePath()?>


But in your code you have forgotten to put the "=" sign. That's why its not showing there. It is php short tag. Generally we can use both <?php ?>, <?= ?> tags for php.

By the way, please hit this as best answer if it helps you. It may help other community members to identify the correct answer.

Citytech
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
I did use this code also, but it didn't work hence posting the problem. The echo part of the php code seems to have fixed it for me.
citytech2 replied on at Permalink Reply
citytech2
Then it might be short tag problem. I think it is off in your php.ini file. If the short tag is off, then it will not work for you. By the way, the best option is to use "echo". It is reliable as well as supported by all server.

Citytech
zapbrannigan1972 replied on at Permalink Reply
zapbrannigan1972
That's fair enough. I can see in the php.ini that it is turned off. Thankyou for your help.