SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 123 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

'index.php?option=com_
myextension &view=video&format=raw&id='.$row->id);
// size in bytes of file
$enclosure->length = $row->length
$enclosure->type = 'video/mpeg';
$item->enclosure = $enclosure;
// add item to the feed
$document->addItem($item);
}
If a view is available in HTML and feed formats, you might want to add a link in the
HTML view to the feed view. We can use the HTML link tag to define an alternative
way of viewing data. This example shows how we can add such a tag to the HTML
header. This code should be located in the view class's display() method.
// build links
$feed = 'index.php?option=com_myextension&format=feed';
$rss = array(
'type' => 'application/rss+xml',
'title' => 'My Extension RSS Feed'
);
$atom = array(
'type' => 'application/atom+xml',
'title' => 'My Extension Atom Feed'
);
Component Design
[ 90 ]
// add the links
$document =& JFactory::getDocument();
$document->addHeadLink(JRoute::_($feed.'&type=rss'), 'alternate',
'rel', $rss);
$document->addHeadLink(JRoute::_($feed.


Pages:
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135