Hello,
I use Evo 1.0.5.
I have a ressource generated with YAMS
http://modx.com/extras/package/yams
in 3 langunges. Each language has a seperate menutitle.
I call the wayfinder like this (works fine):
[[Wayfinder? &startId=`0` &outerClass=`nav` &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/docr/row.tpl` &innerRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/docr/innerrow.tpl` ]]
In my rowTpl I use images (rotated) for the menutitle instead of plain text. I call my snippet in the rowTpl like this:
<li[+wf.id+][+wf.classes+]>
<a href="(yams_docr:[+wf.docid+])" title="[[YAMS? &get=`data` &docid=`[+wf.docid+]` &from=`pagetitle`]]" [+wf.attributes+]> <img src="[[Generate_main_menu_img? &id=`[+wf.docid+]` &text=`((yams_data:[+wf.docid+]:menutitle_(yams_id)))` &lang=`(yams_id)` ]]" alt="" /> ((yams_data:[+wf.docid+]:menutitle_(yams_id))) </a>
[+wf.wrapper+]
</li>
The snippets Generate_main_menu_img gets called in the src attribute of the Image.
The snippet returns the src of the generated image for the navigation.
The pages are cached, the wayfinder is cached and the snippet is cached because I dont want to generate the images new for each page-call. When I remove the cache like [! ... !] for the snipped it works fine. But when I cache it as in this version, nothing happens even if I delete the cache.
The snipped. which generates my images looks like this:
<?php
$img_width = 23;
$img_height = 260;
$font_size = 23;
$angle = 90;
$font = "assets/fonts/svett.ttf";
$path = 'assets/templates/standard/img/nav/'.$lang.'/'.$id.'.gif';
$dimensions = imagettfbbox ( $font_size , $angle , $font , mb_strtoupper($text, 'UTF-8') );
//grey inactive
$im = imagecreate($img_width, $img_height);
$white = ImageColorAllocate ($im, 240, 237, 235);
$black = ImageColorAllocate ($im, 198, 199, 200);
ImageTTFText ($im, $font_size, $angle, 23, -$dimensions[5], $black, $font, mb_strtoupper($text, 'UTF-8'));
imagegif($im, $path);
//red active
$black = ImageColorAllocate ($im, 226, 0, 26);
ImageTTFText ($im, $font_size, $angle, 23, -$dimensions[5], $black, $font, mb_strtoupper($text, 'UTF-8'));
imagegif($im, 'assets/templates/standard/img/nav/'.$lang.'/'.$id.'a.gif');
return $path;
?>
Greetings
Bernd