Designer Content internal links

Permalink
Hello,

I'm using Designer Content which is super usefull.
However there's something I can't figure.
I'm trying to add images (reduced to thumbails), with a link on them to the full size img.
Just by using the Image input.

I managed via Javascript to get the fullsize image relative path, and set it in the Link field. (e.g. 1111/2222/3333/imagename.jpg)
But the final link displayed in the page is transformed to
http://files/1111/2222/3333/imagename.jpg...

I tried to edit the file
/packages/designer_content/generator_templates/controller_url_helper.php
but it seems to do nothing at all.

Could you help?
Is there a better way ?
It could be good to have the option to make internal links other than pages.

Thanks !

okp
 
melat0nin replied on at Permalink Reply
melat0nin
Try adding the DIR_REL constant to your code, like this:

<img src="<?php echo DIR_REL;?>/[rest of path]" alt="" />


That will insert the site's root path before the rest of the URL of your images.
jordanlev replied on at Permalink Reply
jordanlev
You shouldn't modify anything in the designer content package itself -- only the code that's outputted after you create the block.

But for what you want to do you shouldn't need to do that anyway. I think you're accessing the wrong variables. The "relative path" is the file path on the server, which is what you use when you need php code on the server side to work with the image files. But for displaying images to the browser, you don't want the server file path but instead the image "src", which should be accessible via some code like this (in your block's view.php file):
$field_1_image->src


If you can post your block's view.php file and say exactly what it is you want it to do and where it's going wrong, I can provide more specific help.
jordanlev replied on at Permalink Reply
jordanlev
BTW, you should probably re-download Designer Content and replace the package on your server if you've modified the files in the package itself -- otherwise depending on what you did it will probably cause problems later on that will be impossible to diagnose and solve.