diff --git a/lib/WebGUI/Macro/RenderThingData.pm b/lib/WebGUI/Macro/RenderThingData.pm index d5d1d723c..4768c3715 100644 --- a/lib/WebGUI/Macro/RenderThingData.pm +++ b/lib/WebGUI/Macro/RenderThingData.pm @@ -23,7 +23,7 @@ Package WebGUI::Macro::RenderThingData Macro that allows users to render thing data. -=head2 process ( thingURL, templateHint ) +=head2 process ( thingURL, templateHint, callerAssetId ) =head3 thingHint @@ -33,6 +33,11 @@ The URL from which to pull the thingId and thingDataId Optional. Specifies the templateId or template url to use. If omitted, the default thingy view template will be used. +=head3 callerAssetId + +Optional. Passes an assetId to the template (as a template var named callerAssetId) so that the the assetId of of +the caller can be known by the called template. Generally you should pass . + =cut diff --git a/t/Macro/RenderThingData.t b/t/Macro/RenderThingData.t index 3053035f5..246f8b7c8 100644 --- a/t/Macro/RenderThingData.t +++ b/t/Macro/RenderThingData.t @@ -39,7 +39,7 @@ WebGUI::Test->addToCleanup(sub { WebGUI::Test->unmockAssetUrl($templateUrl); }); -plan tests => 6; +plan tests => 7; my $node = WebGUI::Asset->getImportNode($session); my $versionTag = WebGUI::VersionTag->getWorking($session); @@ -119,3 +119,6 @@ $output = WebGUI::Macro::RenderThingData::process($session, $thing_url, $templat ok $templateProcessed, '... passed template url, template processed'; $templateProcessed = 0; +$output = WebGUI::Macro::RenderThingData::process($session, $thing_url, $templateUrl, "fakeAssetId"); +ok $templateVars->{'callerAssetId'} eq 'fakeAssetId', '... passed callerAssetId, template var was passed'; +$templateProcessed = 0;