sitemaps.xml
Google Sitemaps に対応した sitemap の xml ファイルを出力するためのコード
サイズ 1.7 kB - File type text/xmlファイルのコンテンツ
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<tal:plone tal:define="results python:container.portal_catalog(
portal_type = ['Folder', 'File', 'Document',],
review_state=['published', 'visible'],
sort_on='modified' ,sort_order='reverse');
dummy python:request.RESPONSE.setHeader('Content-Type', 'text/xml');
dummy2 python:request.RESPONSE.setHeader('charset', 'UTF-8');"
tal:condition="results"
tal:on-error="nothing">
<url tal:repeat="result results">
<tal:block tal:define="resultObject result/getObject;
type resultObject/portal_type"
tal:on-error="nothing">
<loc tal:condition="python: type != 'File'"
tal:content="resultObject/absolute_url">http://www.yoursite.com/</loc>
<loc tal:condition="python: type == 'File'"
tal:content="string: ${resultObject/absolute_url}/view">http://www.yoursite.com/</loc>
<lastmod tal:content="python: DateTime(resultObject.modified()).HTML4()">2005-01-01</lastmod>
</tal:block>
</url>
</tal:plone>
<tal:coreblog tal:define="entries python:here.takalog.rev_entry_items()">
<url tal:repeat="entry entries">
<loc tal:content="entry/entry_url"></loc>
<lastmod tal:content="python: DateTime(entry.date_created()).HTML4()">2005-01-01</lastmod>
</url>
</tal:coreblog>
</urlset>
Click here to get the file