[FEATURE] Add properties changefreq and priority to XML sitemap entries
[Packages/TYPO3.CMS.git] / typo3 / sysext / seo / Resources / Public / CSS / Sitemap.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="2.0"
3 xmlns:html="http://www.w3.org/TR/REC-html40"
4 xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
5 xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
6 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7 <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
8 <xsl:template match="/">
9 <html xmlns="http://www.w3.org/1999/xhtml">
10 <head>
11 <title>TYPO3 XML Sitemap</title>
12 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
13 <style type="text/css">
14 body {
15 font-family: Helvetica, Arial, sans-serif;
16 font-size: 13px;
17 color: #545353;
18 }
19 table {
20 border: none;
21 border-collapse: collapse;
22 }
23 #sitemap tr:nth-child(odd) td {
24 background-color: #eee !important;
25 }
26 #sitemap tbody tr:hover td {
27 background-color: #ccc;
28 }
29 #sitemap tbody tr:hover td, #sitemap tbody tr:hover td a {
30 color: #000;
31 }
32 #content {
33 margin: 0 auto;
34 width: 1000px;
35 }
36 .expl {
37 margin: 18px 3px;
38 line-height: 1.2em;
39 }
40 a {
41 color: #000;
42 text-decoration: none;
43 }
44 a:visited {
45 color: #777;
46 }
47 a:hover {
48 text-decoration: underline;
49 }
50 td {
51 font-size:11px;
52 }
53 th {
54 text-align:left;
55 padding-right:30px;
56 font-size:11px;
57 }
58 thead th {
59 border-bottom: 1px solid #000;
60 }
61 </style>
62 </head>
63 <body>
64 <div id="content">
65 <h1>TYPO3 XML Sitemap</h1>
66 <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &gt; 0">
67 <p class="expl">
68 This XML Sitemap Index file contains <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/> sitemaps.
69 </p>
70 <table id="sitemap" cellpadding="3" width="100%">
71 <thead>
72 <tr>
73 <th>Sitemap</th>
74 <th>Last modified</th>
75 </tr>
76 </thead>
77 <tbody>
78 <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
79 <xsl:variable name="sitemapURL">
80 <xsl:value-of select="sitemap:loc"/>
81 </xsl:variable>
82 <tr>
83 <td>
84 <a href="{$sitemapURL}"><xsl:value-of select="sitemap:loc"/></a>
85 </td>
86 <td>
87 <a href="{$sitemapURL}"><xsl:value-of select="sitemap:lastmod"/></a>
88 </td>
89 </tr>
90 </xsl:for-each>
91 </tbody>
92 </table>
93 </xsl:if>
94 <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) &lt; 1">
95 <p class="expl">
96 This XML Sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs.
97 </p>
98 <table id="sitemap" cellpadding="3" width="100%">
99 <thead>
100 <tr>
101 <th width="40%">URL</th>
102 <th title="Last Modification Time" width="20%">Last Mod.</th>
103 <th title="Change frequency" width="20%">Change freq.</th>
104 <th title="Priority" width="20%">Priority</th>
105 </tr>
106 </thead>
107 <tbody>
108 <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
109 <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
110 <xsl:for-each select="sitemap:urlset/sitemap:url">
111 <tr>
112 <td>
113 <xsl:variable name="itemURL">
114 <xsl:value-of select="sitemap:loc"/>
115 </xsl:variable>
116 <a href="{$itemURL}">
117 <xsl:value-of select="sitemap:loc"/>
118 </a>
119 </td>
120 <td>
121 <xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"/>
122 </td>
123 <td>
124 <xsl:value-of select="sitemap:changefreq"/>
125 </td>
126 <td>
127 <xsl:value-of select="sitemap:priority"/>
128 </td>
129 </tr>
130 </xsl:for-each>
131 </tbody>
132 </table>
133 </xsl:if>
134 </div>
135 </body>
136 </html>
137 </xsl:template>
138 </xsl:stylesheet>