HTML Block Images2 users found helpful
This is my first question and first of all im from Chile, so my english is not very good, but i will try.
I can not place an image correctly in the "HTML Block".
I tried with:
src="<?php echo DIR_REL; ?>/images/image.png"
and does not work any of them.
I have read that the "HTML block" does not read PHP code. Is it true?
I DONT WANNA USE this:
Simple PHP block and Code Blocks
and nothing :(
As you have read, the html block does not process php. So you need to write the full html for your image.
If it is a more complex html block, you are using it more than once or need to change the image, then you could use Designer Content to create a block that displays your image and edit the view of the generated block to add your html.
Thanks for you answer John
For most sliders or galleries, the easy answer is to build your block to use a fileset.
Thanks for your time.
In the case of my site above, CCM_REL is null because the URL points to the root of my site.
On an offline development copy of the site, the equivalent line for CCM_REL is:
var CCM_REL = "/cms/development552";
By copying the /files folder and databases between the sites, the paths within /files are identical.
If I have an image at /files/1234/5678/9101/mypic.jpg, it will be in this folder for both sites.
I could then code a site independent path to it using
If my site moved to another host, or to a subdirectory, I would not need to change the code.