Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Delicious widget problems [Solved]

Go to End



Community Member, 1 Post

10 December 2007 at 1:13pm

Edited: 10/12/2007 1:56pm

Actually solved my issue. Was using variables in function instead of $this->User.
Hello, I'm trying to write a 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


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 = "".$User."?count=".$NumberToShow.";title=".$Name .";icon;name;showadd";
        	$LinkVar2 = "".$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</a>
	<script type="text/javascript" src="$Link"></script>
	<a href="$Link2">$Title</a> 
<% end_control %>