Images not displaying (again)

Permalink
Hi there,

I've posted a question about this in the past. Basically I'm creating another new site in Concrete5 - custom theme, and I'm having trouble with getting any images, hard coded into the theme pages, to show.

I've tried all the methods that made this work in the past...clearing cache, switching off all cache, also:
<?php echo $this->getThemePath(); ?>/
and
<?=$this->getThemePath()?>/
I've also tried editing the config file, but that broke the site.

The website is here:http://model-citizens.co.uk/new/...
It's in a sub folder so I don't know if that might be the problem?

Any advice would be greatly received!!

Thanks

Lou

 
drbiskit replied on at Permalink Reply
drbiskit
To link to images, you should be fine with what you have - to confirm, you can use this, it's correct:
<img src="<?php echo $this->getThemePath()?>/filename.png" alt="" />


Having the site in the subdirectory is not a problem, but you do need everything setup correctly to resolve to the right place. It can be a bit fiddly...

The path that your image files are looking at currently is this - eg:
/new/concrete/themes/modelcitizens/images/modelcitizens.gif

So - you can see that it's looking for the theme in the 'concrete' directory, so that is not right. Once you remove 'concrete' from the path, the image loads correctly.

Have you tried uninstalling, and then reinstalling your theme maybe?
lou28 replied on at Permalink Reply
Yes, I've just tried uninstalling and reinstalling...not sure what else I can try!?
drbiskit replied on at Permalink Best Answer Reply
drbiskit
Ah just found something in the forums about this...

Have you got a 'default.php' file in your theme? If not, try adding one, even if blank.

Source:
http://www.concrete5.org/developers/bugs/5-6-0-2/using-get-themepat...
lou28 replied on at Permalink Reply
Ahh... spot on, and so simple too! Thank you so much :)
justrj replied on at Permalink Reply
justrj
try this: <?=$this->getThemePath()?>/../path_you_are_using