-
☆ A M B ☆
- 24,524 Posts
I am stuck on trying to make a custom placeholder. I really don’t "get" how to make an extender.
What I am trying to do is have a [+details+] placeholder that will pull in the new $_lang[’details’] item I’ve added to the relevant language files, for the "read more..." text before the link. I thought it would be easier to just hack the ditto core, but I’m determined to do it the right way with a custom extender.
So far everything I’ve tried just completely breaks Ditto (no output at all). :’( :’(
Hi Susan,
could you post the code you wrote ?
:-)
-
☆ A M B ☆
- 24,524 Posts
After much messing around, I ended up with (details.extender.inc.php)
<?php
$param = isset($param) ? $param : "default";
$placeholders['details'] = array($_lang['details']);
?>
and the Ditto call
[!Ditto? &id=`teaser` &parents=`104` &tpl=`newsTpl` &display=`1` &language=`german` &extenders=`details`!]
-
☆ A M B ☆
- 24,524 Posts
When I get this figured out I’ll write a Howto in the wiki.
-
☆ A M B ☆
- 24,524 Posts
Nope, appears that the $_lang array is not available at this point. I also tried including the language file, but it appears that even the $language variable is not available. I’m sure there’s some way of passing it into the extenders facility. At least it didn’t kill the entire Ditto call, though.
The site has four languages; I could just make four different template chunks, but that’s too easy!
-
☆ A M B ☆
- 24,524 Posts
-
☆ A M B ☆
- 24,524 Posts
No. err.... no execute Parser call in manager/index.php??