Closed (fixed)
Project:
Token
Version:
6.x-1.12
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Nov 2009 at 21:24 UTC
Updated:
21 Mar 2010 at 02:50 UTC
I have something like the following:
<?php
function studiosundew_token_values($type, $object = NULL) {
$values = array();
switch ($type) {
case 'node':
$node = $object;
$random_image = views_embed_view('random_image');
$values['image-view'] = $random_image;
break;
}
return $values;
}
?>
And I'm using the token filter module so I can add tokens like [token node image-view] into my node content. This works and a random image appears in my node. ALMOST perfect!
Any pointers as to how I can make it so that I can have multiple [token node image-view]s in each node, each one returning a new random image? At the moment, it simply repeats the same image.
Many thanks.
Comments
Comment #1
mshepherd commentedI got this working with multiple tokens, rather than multiple uses of the same token. So, tokens like [token node randomimage1], [token node randomimage1] and [token node randomimage3].
Comment #2
dave reid