None of the themes I download use <?=$this->getThemePath()?>/

Permalink
In the screencast, this little PHP snippet was used before every relative CSS, Javascript or image path and I added it to my template, too, as per the instructions.

But, in Vanilla Yogurt default theme or Greensalad theme, I don't see this <?=$this->getThemePath()?>/ snippet anywhere. How does one get around using this?

I'm seeing <?php echo DIR_REL?>/ ... is that basically the same thing?

 
zoinks replied on at Permalink Reply
nobody else has noticed this?

It's very strange! I would certainly like to avoid sticking this bit of PHP before every relative path if possible!
imeos replied on at Permalink Reply
imeos
Don't know if you found out by ourself yet, but
<?= $this->getThemePath(); ?>
is the short_tag form of
<?php  echo $this->getThemePath(); ?>



Its not considered good practice to leave short tags in PHP code you publish, as its a PITA if you ever have to move code to a server where they are not supported.
It's up to you to use them while developing, several methods and scripts exist, to convert them to the usual, long-tags before deploying your code.

Btw. The default theme at the moment — Greek Yogurt — uses
<?php  echo $this->getThemePath(); ?>
in it's header.php to include several stylesheets ;-)
andrew replied on at Permalink Reply
andrew
We automatically convert short tags into <?php tags whenever anything is uploaded into our marketplace, btw. The core concrete5 code also uses short tags in github, but they are translated whenever we do an official release.
imeos replied on at Permalink Reply
imeos
Yeah i know, as Ryan from the core-team explained this in one of his forum-posts, as a beta-tester for the 'Internationalization' Add-On got some errors during installation, but thanks for the fast reply.
zoinks replied on at Permalink Reply
what does...

<?php echo DIR_REL?>/


mean?

I see that there is a "short tag" for the "echo" portion... but, if memory serves the thing that was confusing me was the "DIR_REL?" It seems to be Concrete5 specific since if I Google <?php echo DIR_REL?>/ all I see are C5 results.
poetze replied on at Permalink Reply
poetze
thanks, for the answer. now I know why my theme is not working on my liveserver. ;)
Is there anywhere a list of the equivalents in long-term for the other expressions often used in themes. For exmple I also don't get the header displayed.

Thanks a lot
sarah
citytech2 replied on at Permalink Reply
citytech2
Hi poetze,
You can create a php.ini file with the short tag enabled. Just open a notepad, Put
short_open_tag=On
on that page & upload it to the root directory, most of the cases it should be public_html. And see it will work.



Citytech
poetze replied on at Permalink Reply
poetze
Thanks! It worked :)