Path Update issue in $this->getThemePath() (Possible bug?)1 user found helpful
The main theme seems to process
<img src="<?php echo $this->getThemePath(); ?>/img/logo.jpg" width="277" height="102" />
correctly, and renders the above as
where "theme1" is the main theme of the site.
However, on a page using a template in the NEW theme, the very same structure
<img src="<?php echo $this->getThemePath(); ?>/img/logo2.jpg" width="277" height="102" />
where "theme2" is the newer theme.
It seems to be appending the update path (which is correctly used for the C5 furniture in BOTH themes) to the theme-relative path that is being returned by $this->getThemePath().
I tried using the view instance with
$v = View::getInstance(); $view=$v->getThemePath();
but $view contains exactly the same path as $this->getThemePath(). Anybody seen this? It's a little urgent as this site was due to go live tomorrow, and i'll have to hack in some hardcoding (which i hate) until I can dive into the core and get to the bottom of it!
Thanks in advance!
<?php echo $this->getThemePath(); ?>
Returns: /concrete/themes/ ....
And it should be: /themes/ ...
Had to: include($this->getThemePath() . '/elements/header.php');
I figured out my issue. Even tho I had created an EMPTY site, there are pages like Edit, Avatar, and Messages that utilize view.php. I noticed this when I couldn't delete the default page type of Right_Sidebar even tho I only had 1 home page set to the Full page type. The theme I created only had the default.php. After activating my theme and trying to visit the Profile->Edit page through site map, I received the missing "/concrete/themes/zenlike/elements/header.php" message. I simply copied my default.php to view.php and adjusted the content to "print $innerContent" instead of the usual $a = new Area("some area"); and the Edit page showed up without error. As stated in the documentation, View.php is required just like Default.php. I would also add full.php to this list cause when you activate the new theme, other pages probably have that default named page type associated.
I thought at first this above comment had got mis-posted from another thread but, no, it is correct, however odd that seems. Whatever templates you're actually using in your theme, you *must* have a 'view.php' and a 'default.php' there, otherwise getThemePath() will not return the correct path. (I got the full site path with an extra, unwanted "/concrete" in - it was all correct, except for that, which was breaking it)
Took most of this afternoon to get there, but that's fixed it. Don't remember this from previous versions, but it's definitely the case in v220.127.116.11
Hope that helps somebody ...