Hi all,
http://net.tutsplus.com/videos/screencasts/how-to-build-a-super-duper-news-scroller/
I am trying to integrate this with my Modx site, but I am having some issues. Mainly because I suck badly at PHP.
What I have done so far.
Created my own Ditto feed (
http://ditto.modxcms.com/tutorials/custom-rss-feed.html)
-That was easy enough
Created a snippet with the following code to get SimplePie going
<?php
require 'simplepie.inc';
$feed = new SimplePie('http://net.tutsplus.com/rss');
$feed->handle_content_type();
?>
That was also pretty straight forward.
Now I need to somehow get the html+php code for showing the actual news items into my template. The code looks something like this taken straight from the tutorial:
<ul id="widget">
<?php foreach($feed->get_items(0, 15) as $item) : ?>
<li>
<?php echo $item->get_description(); ?>
<h4><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h4>
<p>
<?php echo $item->get_date(); ?>
</p>
</li>
<?php endforeach; ?>
</ul>
The problem is here, that no matter how I try to include it, as a chunk or a snippet or directly into my template, it screws up badly, resulting in a blank page.
So, my question is now, how can I include this without having to re-write it too much? (Since re-writing is hard when you are a php newb)
Oh I also tried requiring it as a php file. That didnt work as well.
Thanks to all that are still reading
-larsb