box-head,
What happens if you use it within a template?
It works there for me
<?php
$src = "/images/uploads/test-image.jpg";
$src = "/".$src;
$src = $this->EE->functions->remove_double_slashes($src);
//$src returns "/images/uploads/test-image.jpg"
echo $src
?>If it works there can you provide some more of what your plugin is doing please
Debugging a little further, the problem occurs when using the plugin within the imgsier plugin.
Like so.
{exp:imgsizer:size src="{event-image}" width="1020" height="420"}
{exp:new_plugin:method src="{sized}"}
{/exp:imgsizer:size}Imgsizer outputs {sized} which equals /images/sized/images/uploads/photo.jpg New_plugin then outputs //images/sized/images/uploads/photo.jpg
Is it supposed to be possible to nest plugins like this?
As an update - I got the the functionality I require working using an embed like so.
{exp:imgsizer:size src="{image}" width="1020" height="420" alt="{title}"}
{embed=embeds/image-modify file="{sized}"}
{/exp:imgsizer:size}then in embeds/image-modify
{exp:my_plugin:method src='{embed:file}'}The earlier problem actually seemed to be that the variable {sized} from imgsizer wasn’t returning a src by the time my plugin used it, so the value of my “src” parameter was using the string “{sized}” rather than an actual src value such as /images/sized/uploads/file.jpg
I assume this is something to do with the parse order? Is that right?
Is using an embed the most suitable way to nest plugins like this or am I missing something? Thanks
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.