<li><a href="[[+rssUrl]]" title="[[+rssTitleHover]]" class="tooltip">[[+rssTitle]]</a></li>
//Assign the data
$data = array(
'rssUrl' => $xml->channel->item[$i]->link,
'rssTitle' => $truncTitle,
'rssTitleHover' => $xml->channel->item[$i]->title,
);
$output .= $modx->getChunk('rssListResults',$data);[[!rssFetch? &rssFeedLink=`http://url.to.rss` &rssFeedLimit=`5`]]
//Set the link var
$link = "http://test.com/";
//Output the raw data
echo $link;
//Output it via the chunk
$output = $modx->getChunk('myChunk',array(
'name' => $link,
));
//Set the link var
$link = $xml->channel->item[1]->link;
//Output the raw data
echo $link;
//Output it via the chunk
$output = $modx->getChunk('myChunk',array(
'name' => $link,
));
Thanks for the reply. Wouldn’t it be considered a bug? I’m not quite sure what difference it would make between a var generated by XML or just a regular manually declared var. Even when I echo the $xml var directly, it outputs the correct thing. Modx just won’t pass it to the chunk for some reason.
<?php
//Start cURL connection
$ch = curl_init($rssFeedLink);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
//Fetch RSS data and close the connection
$data = curl_exec($ch);
curl_close($ch);
//Start up SimpleXML class
$xml = new SimpleXmlElement($data, LIBXML_NOCDATA);
$http = $xml->channel->item[0]->link;
$title = $xml->channel->item[0]->title;
$output = $modx->getChunk('myChunk',array(
'name' => $http
));
?>
return $output;

.
. Here’s the code (hopefully I didn’t miss something again
)
<?php
//Start cURL connection
$ch = curl_init($rssFeedLink);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
//Fetch RSS data and close the connection
$data = curl_exec($ch);
curl_close($ch);
//Start up SimpleXML class
$xml = new SimpleXmlElement($data, LIBXML_NOCDATA);
$rssResultLink = $xml->channel->item[0]->link;
echo "Echo: ".$rssResultLink;
$output = $modx->getChunk('myChunk',array(
'myRssLink' => $rssResultLink
));
return $output;
<br />Chunk Result: [[+myRssLink]]
$output = $modx->getChunk('myChunk',array(
'name' => $http
));
return $output;