Login | Forgot password | Register
What is OpenID?
OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.
With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.
For more information visit the official OpenID site.
Widgets
SilverStripe Forums » Widgets » Returning Feed Data as HTMLText
Discuss SilverStripe Widgets.
|
Page:
1
|
Go to End | |
| Author | Topic: Returning Feed Data as HTMLText | 554 Views |
-
Returning Feed Data as HTMLText

13 January 2009 at 5:09pm
I have modified the CNN News reader to read my client's blog. However, I would like to return the description as HTML Text. So what happens, is I read the blog, loop through the RSS feed and create an output array just like the CNN Widget. But in my template, I want to be able to take advantage of the methods available for HTMLText object types. Is there anyway to do the following, but return one of the elements as HTMLText:
$output->push(
new ArrayData(
array(
"Title" => $title,
"URL" => $link,
"Body" => $description
)
)
);I went through just about all the widgets examples and I do not see anything that leads me to believe this is possible, but the widget examples aren't exactly pushing the edge of the envelope either. Any help would be appreciated.
Thanks!
-
Re: Returning Feed Data as HTMLText

27 January 2009 at 10:52am Last edited: 27 January 2009 10:52am
Perhaps something like this could work:
$obj = new HTMLText("Body");
$obj->setValue($description);$output->push(
new ArrayData(
array(
"Title" => $title,
"URL" => $link,
"Body" => $obj
)
)
);Now Body is of the type HTMLText and can use the methods of it?
Just a guess, haven't tried this myself, but something like this could work
-
Re: Returning Feed Data as HTMLText

27 January 2009 at 7:02pm Last edited: 27 January 2009 7:04pm
Instead of $description, try using $ParsedContent.
Not sure if that's what you're looking for, but it worked for me with local blog entries.
(To clarify, I used $ParsedContent in the template.)
| 554 Views | ||
|
Page:
1
|
Go to Top |
Currently Online: swaiba, behaviourneeds, wmk
Welcome to our latest member: behaviourneeds


