Actually solved my issue. Was using variables in function instead of $this->User.
----------------------------
Hello, I'm trying to write a del.icio.us linkroll widget and am having some problems. The problem I'm having is that it seems the variables from the php file are not making it to the ss file. It isnt a javascript issues, since the code works when I put it in the ss file without all the variables. There is also a test link to google in the ss file that does display but the script does not. Any help would be appreciated.
My code is bellow:
The .php file
<?php
class DeliciousWidget extends Widget {
static $db = array(
"User" => "Varchar",
"Name" => "Varchar",
"NumberToShow" => "Int"
);
static $defaults = array(
"NumberToShow" => 8
);
static $title = "Delicious";
static $cmsTitle = "Delicious Linkroll";
static $description = "Shows delicious links.";
function Links() {
$LinkVar = "http://del.icio.us/feeds/js/".$User."?count=".$NumberToShow.";title=".$Name .";icon;name;showadd";
$LinkVar2 = "http://del.icio.us/".$User;
// $delicious = new DeliciousService();
$output = new DataObjectSet();
$output->push(new ArrayData(array(
"Title" => $Name,
"Link" => $LinkVar,
"Link2" => $LinkVar2
)));
return $output;
}
function getCMSFields() {
return new FieldSet(
new TextField("User", "User"),
new TextField("Name", "Linkroll Name"),
new NumericField("NumberToShow", "Number to Show")
);
}
}
?>
And the .ss file
<% control Links %>
<a href="google.com">Google</a>
<script type="text/javascript" src="$Link"></script>
<a href="$Link2">$Title</a>
<% end_control %>