Hi all,
I’m developing a module and am trying to have something like {filedir_XX}newsletter_sponsor.jpg rendered as http://www.mysite.com/newsletter_sponsor.jpg. I understand the Typography class is supposed to do this, but I’m not having any luck. Here is my code:
if (!class_exists('Typography')) require PATH_CORE.'core.typography'.EXT;
$TYPE = new Typography; // also tried: new Typography(TRUE, TRUE);
$temp = $TYPE->parse_type($sponsor['image']);
var_dump($temp);
But the output is just {filedir_XX}newsletter_sponsor.jpg, not the fully rendered image URL. Am I not using $TYPE correctly? I’m not getting any error messages, so I believe I am using it correctly.
Any help very much appreciated.
Hi Greg,
Thank you for the reply.
I will take a look at fetch_file_paths().
But I would still like to understand why my use of the Typography class is incorrect? According to the docs here, rendering {filedir_XX} is exactly one of the things the class is meant to do. From the docs:
…if you wanted to have {filedir_#} variables parsed…
Can you tell me where I’m going wrong with how I’m using $TYPE?
Thanks!
I have a feeling you may be affected by a bug fixed in 1.6.7 build 20090211.
Fixed a bug where {filedir_#} variables were not being parsed in user submitted content when Allow All HTML was used.
Hey Derek,
Thank you for the follow-up. It took me a few days to get around to upgrading to 1.6.7. But I finally did that tonight, and YES, it looks like it solved the problem! The {filedir_XX} text is now rendering correctly, using the syntax I described above.
Great support, thank you 😊
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.