Commit 29b519ef authored by Thomas Löffler's avatar Thomas Löffler

[FEATURE] First working attempt of a google sitemap for pages

parent c66fa897
Pipeline #270 passed with stage
in 1 minute and 32 seconds
<?php
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
$frontendLanguageFilePrefix = 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:';
$languageFilePrefix = 'LLL:EXT:just_sitemap/Resources/Private/Language/locallang_be.xlf:';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
[
$languageFilePrefix . 'CType.google_sitemap',
'google_sitemap',
'content-special-menu'
],
'menu',
'after'
);
$GLOBALS['TCA']['tt_content']['types']['google_sitemap'] = [
'showitem' => '
--palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
--palette--;' . $frontendLanguageFilePrefix . 'palette.header;header,
pages,recursive,
--div--;' . $frontendLanguageFilePrefix . 'tabs.appearance,
--palette--;' . $frontendLanguageFilePrefix . 'palette.frames;frames,
--div--;' . $frontendLanguageFilePrefix . 'tabs.access,
--palette--;' . $frontendLanguageFilePrefix . 'palette.visibility;visibility,
--palette--;' . $frontendLanguageFilePrefix . 'palette.access;access,
--div--;' . $frontendLanguageFilePrefix . 'tabs.extended,rowDescription,
--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category,categories'
];
\ No newline at end of file
tt_content {
google_sitemap =< lib.fluidContent
google_sitemap {
templateName = GoogleSitemap
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = pages
pidInList.field = pages
recursive.field = recursive
selectFields = pages.*
where = NOT hidden AND NOT nav_hide AND doktype NOT IN ({$plugin.tx_justsitemap.doktypesToIgnore})
where.insertData = 1
languageField = sys_language_uid
orderBy = sorting
as = pages
}
}
}
}
config.disableAllHeaderCode = 1
config.doctype = none
config.additionalHeaders = Content-type:text/xml
plugin.tx_justsitemap {
doktypesToIgnore = 3,4,6,199,254,255
}
\ No newline at end of file
lib.fluidContent {
templateRootPaths {
30 = EXT:just_sitemap/Resources/Private/Templates
}
partialRootPaths {
30 = EXT:just_sitemap/Resources/Private/Partials
}
layoutRootPaths {
30 = EXT:just_sitemap/Resources/Private/Layouts
}
}
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:just_sitemap/Configuration/TypoScript/RenderingDefinitions" extensions="ts">
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="14.10.16T16:14Z" product-name="just_sitemap">
<header/>
<body>
<trans-unit id="CType.google_sitemap" xml:space="preserve">
<source>Google sitemap</source>
</trans-unit>
<trans-unit id="wizard.title" xml:space="preserve">
<source>Google sitemap (just_sitemap)</source>
</trans-unit>
<trans-unit id="wizard.description" xml:space="preserve">
<source>Google sitemap for pages</source>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<f:if condition="{pages}">
<f:groupedFor each="{pages}" as="groupedPages" groupBy="pid">
<f:for each="{groupedPages}" as="page">
<url>
<loc><f:uri.page pageUid="{page.data.uid}" absolute="1" /></loc>
<lastmod><f:format.date format="Y-m-d">{page.data.SYS_LASTCHANGED}</f:format.date></lastmod>
</url>
</f:for>
</f:groupedFor>
</f:if>
</urlset>
\ No newline at end of file
<?php
/**
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
defined('TYPO3_MODE') || die ('Access denied.');
$boot = function ($packageKey) {
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
$packageKey,
'Configuration/TypoScript/',
'Google Sitemap'
);
};
$boot($_EXTKEY);
unset($boot);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment