圖片站點地圖我生成使用Zend_Navigation一個網站地圖,我想圖像添加到該地圖,現在我還是不知道如何完成這件事,我用下面的(工作)代碼來生成網站地圖與Zend_Navigation
foreach($sitemapItems as $item)
{
$newSite = new Zend_Navigation_Page_Uri();
$newSite->uri = 'http://' . $_SERVER['HTTP_HOST'] . $item->getSpeakingUrl();
$newSite->lastmod = $item->getUpdatedAt();
$newSite->changefreq = 'weekly';
$this->_navigation->addPage($newSite);
}
$this->view->navigation($this->_navigation);
$this->view->navigation()->sitemap()->setFormatOutput(true);
輸出如下:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://test.dev/pictures/site-28.html</loc>
<lastmod>2010-03-11T17:47:30+01:00</lastmod>
<changefreq>weekly</changefreq>
</url>
....
我所需要的地址部內的以下輸出
<image:image>
<image:loc>http://example.com/image.jpg</image:loc>
</image:image>
我想剛纔設置
$newSite->image = URI
,但它沒有工作,我也試圖通過添加自定義屬性
$newSite->__set('image', array('loc' => URI));
有誰知道我想要什麼,甚至有可能?我找不到在文檔或網頁什麼...
感謝您的時間, 多米尼克