rainlab / sitemap-plugin Goto Github PK
View Code? Open in Web Editor NEWGenerator for sitemap.xml files in October CMS
License: MIT License
Generator for sitemap.xml files in October CMS
License: MIT License
I tried to add the sitemap definitions in the backend, but they aren't saved to the database, so when I reload the page, it's empty again. On http://domain/sitemap.xml, all I see is this.
I read the other issues with the same problem, but I couldn't find a working solution.
Google recommends using different URLs for each language version of a page rather than using cookies or browser settings to adjust the content language on the page.
It will be possible to implement urls with the language tag?
Regards
If the plugin is installed on a server that does not have the php-xml installed, it will just fail with an exception, that it cannot find the DOMDocument class.
Class 'DOMDocument' not found
.../plugins/rainlab/sitemap/models/Definition.php line 156
I resolved it by installing php7.0-xml on my instance:
sudo apt-get install php7.0-xml
Would be nice if the plugin could check for that module's existence before installing.
production.ERROR: exception 'ErrorException' with message 'Undefined index: ' in /plugins/rainlab/sitemap/formwidgets/SitemapItems.php:106
This error appears when I go to index page of the plugin in adminpanel.
The documentation states that the dropdown in the "blog categories" type, refers to all the cms pages that have the component "blogPosts" implemented. I do have the page, only it does not populate said dropdown.
Is there something I'm missing, or is this a bug?
Hi I would like to edit the physical file of sitemap.xml manually. May I know what is the folder path of sitemap.xml in october cms? Thanks.
Hello,
I noticed the following error on OctoberCMS v3.4.9 (with enabled MultiSites), while viewing the generated sitemap.xml.
[2023-07-22 13:00:51] prod.ERROR: ErrorException: Undefined property: RainLab\Sitemap\Classes\DefinitionItem::$sites in /modules/cms/classes/Page.php:213
Simple fixed it by adding public $sites;
on the shown sitemap/classes/DefinitionItem.php
file.
Sincerely,
Sam.
The sitemap plugin supports the Blog- and Forum plugin out of the box. I was wondering if it's at all possible to extend this functionality to custom plugins.
My plugin consists of a list of items, each one having their own url. It would be nice if I could get my items into the sitemap without having to define them manually per item (because items will be added / renamed / removed).
The documentation seems to stay a little vague about this. Is this possible and if so, is there a working example available somewhere?
Thanks in advance.
Noticed that the url under tag has repeated domain when i add problog tag on sitemap via plugin.
The is
domain.com/domain.com/blog/tag
How to remove the repeated domain.com?
It's not showing blog posts and categories.
Error on /sitemap.xml page after install
Hey,
It seems that Google indexes the sitemap.xml url and displays it in the search results.
Is it possible to include the tag X-Robots-Tag: noindex in the HTTP response?
See more info: https://webmasters.stackexchange.com/questions/62978/prevent-xml-sitemaps-from-showing-up-in-google-search-results
Regard,
Darjan
Hi,
My sitemap returns HTML content type instead of XML with the last build (224). Maybe a wrong ngix conf ?
I am running Octobercms 2.2.25 and plugin version 1.2.0 and I am getting an error on the sitemap.xml whether I add items to the site map or even if it is blank.
The error is
This page contains the following errors:
error on line 2 at column 6: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.
..and nothing else follows
The plugin currently adds URLs for blog posts even if they aren't published.
The plugin should either only list the blog posts that are published or it should also add the blog post to the robots file as a URL that shouldn't be visited.
EDIT: This is being reported as I'm seeing URL errors show up in my webmaster console.
Hi there, I have problem showing dynamic parameters in url's for pages that are using models made in Builder plugin.
Example page :
url = "/product/:slug"
layout = "default"
title = "Product"
==
<?php
use Codeupp\Client\Models\Product;
function onStart(){
$slug = $this->param('slug');
$product = Product::where('slug', $slug)->first();
if(!$product){
return Redirect::to('/');
}
$this['product'] = $product;
}
?>
==
and sitemap object for this url looks like this:
<url>
<loc>https://client.com/product/default</loc>
<lastmod>2023-06-09T14:07:43+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
Is there a way for me to make this work somehow, or is my approach wrong here? Thanks.
We built a site with 100 static pages that only consist of a parent and max one-child navigation.
When we setup the sitemap- we simply added "All Static Pages".
When we attempt to view it- we receive the following error:
2017/06/09 17:13:51 [error] 18455#18455: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error: Maximum function nesting level of '1000' reached, aborting! in /vendor/laravel/framework/src/Illuminate/Support/Arr.php on line 238
Increasing the xdebug.max_nesting_level
seems like a bandaid to a bigger problem.
The sitemap includes blog posts that have not been published in to the sitemap.xml which leads the crawlers to a 404 page. This should not happen.
Hi all,
When I create a page/sub-page structure, the master pages are shown in the sitemap even if they are empty of any content (in the case of use at the top of a heading).
I can't find an option like in the menus of the 'Static page' plugin to include children instead of the page itself.
Is there an option, or do I need to extend the plugin to include this functionality?
I find it very tedious to implement the logic for generating custom itemTypes like blog-post
and all-blog-posts
. I keep copying the logic again and again for each project/plugin.
I'm looking at ways to make this proces easier/less tedious. It might be an idea to add custom behaviours to this plugin, so we only need to define the parameters necessary to output custom post types.
My suggested approach:
resolveMenuItem
etc$itemType = 'blog-post';
$componentName = 'blogPost';
$scope = `isVisible`;
Hurdles I can think of:
blog-post
vs all-blog-posts
)blog-post
/ category
etc)Does anyone have any input into this matter?
This plugin only creates a single sitemap file....?
You need to update this to be able to create multiple sitemaps e.g.
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://www.example.com/sitemap1.xml.gz</loc>
<lastmod>2004-10-01T18:23:17+00:00</lastmod>
</sitemap>
<sitemap>
<loc>http://www.example.com/sitemap2.xml.gz</loc>
<lastmod>2005-01-01</lastmod>
</sitemap>
</sitemapindex>
If you disable this plugin, it doesn't remove the URL from the known routes in the CMS.
October: 430
Sitemap: 1.0.8
Expected behavior:
Disabling sitemap in settings, should throw 404 when going to /sitemap.xml.
Actual behavior:
Disabling sitemap in settings, still shows the sitemap when going to /sitemap.xml
Call to undefined method RainLab\Sitemap\Classes\DefinitionItem::resolveAttribute()
/var/www/html/myproject/modules/backend/Widgets/Form.php line 917
October build 220
917: list($model, $attribute) = $this->model->resolveAttribute($htmlArray);
I'm having a problem when I try to use the blog category posts option, in that all the posts are being rendered with /default/ instead of the category.
I'm not sure if this is a bug with the sitemap plugin or something to do with the setup we have - the URL's all render fine on the front-end in the blog itself, and when I use blog category it has the correct URL as well.
Any ideas?
I added some data for sitemap. but the sitemap content is empty of http://domain/sitemap.xml
That page content displayed without I added data, like this:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"/>
How can I fix this problem?
Hi!
I installed your sitemap plugin to my project, but when I tried to add a sitemap, nothing has happend. As I checked in the inspector, some JS files drops error 404. Any ideas what can I do?
There is an immediate line break at the start of the rendered XML file which causes an error on line 2 at column 6: XML declaration allowed only at the start of the document.
This behaviour is in our production environment but not in development with apparently same config and both on the latest version of the plugin. Have tried looking at plugin code and can't see why this is happening or how to fix it.
The rest of the sitemap.xml file is correct but not being read as failing before rendering any of the page up to the first error.
It could be really nice if you can add permissions.
Any user can access it in backend.
Hi,
I might be overlooking something, but in my setup (over multiple sites) when I navigate to https://domain.com/sitemap.xml, the enclosed file is just being downloaded instead of showing the actual sitemap:
I'm using October CMS v2.1.24 and the Rainlab Sitemap plugin version 1.1.1. I'm using a mirrored setup. I've followed the Nginx instructions you provided here:
https://docs.octobercms.com/2.x/setup/deployment.html#nginx-configuration
Can you kindly let me know how we can solve this? I'd be happy to provide more details.
Kind regards.
<?php namespace AzatTemirbekUulu\Bloger;
use AzatTemirbekUulu\Bloger\Models\Newz;
class SitemapItem {
var $changefreq;
var $priority;
var $type;
var $url;
public function __construct($url)
{
$this->changefreq="always";
$this->priority="0.5";
$this->type="url";
$this->url='http://'.$_SERVER['HTTP_HOST']."/news/".$url;
}
}
class Plugin extends PluginBase{
public function boot()
{
\Event::listen('pages.menuitem.resolveItem', function($type, $item, $url, $theme) {
$list=array();
foreach (Newz::all() as $item) {
return (array) new SitemapItem($item->slug);
}
});
}
}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://localhost:8000/bayiler</loc>
<lastmod>2017-11-20T10:46:48+00:00</lastmod>
<changefreq>always</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>
http://localhost:8000/news/wilke-endustriyel-yag-bloomberg-ht-yayini
</loc>
<lastmod>2017-11-27T11:07:24+00:00</lastmod>
<changefreq>always</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>http://localhost:8000/news</loc>
<lastmod>2017-11-24T11:19:09+00:00</lastmod>
<changefreq>always</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>
http://localhost:8000/news/wilke-endustriyel-yag-bloomberg-ht-yayini
</loc>
<lastmod>2017-11-27T11:07:24+00:00</lastmod>
<changefreq>always</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>http://localhost:8000/*</loc>
<lastmod>2017-11-27T11:07:24+00:00</lastmod>
<changefreq>always</changefreq>
<priority>0.5</priority>
</url>
</urlset>
http://localhost:8000/news/wilke-endustriyel-yag-bloomberg-ht-yayini
is duplicating
I am currently unable to visit /backend/rainlab/sitemap/definitions/update/1
on a October 2.1/2.2 installation:
"Attempt to read property "theme" on null" on line 73 of plugins/rainlab/sitemap/controllers/Definitions.php
The $model
is empty:
https://github.com/rainlab/sitemap-plugin/blob/master/controllers/Definitions.php#L72
it's always empty, even i add something on it
OctoberCMS Build: ### 3.1.21
RainLab Sitemap-Plugin Version: ### 1.2.3
PHP Version: 8.1.4
EventLog
No sitemap definition was found. Try creating one first.
Hi, I've been experiencing issues when trying to reorder items.
The problem occurs only if the list is bigger than the page (and the scrolling bar appears). For example if the page can show 10 list elements, there are problems reordering all the elements from the 11th.
It looks like the plugin doesn't take into account the scroll position of the list.
Thanks in advance
Error after update from Sitemap plugin 1.2.0 to 1.2.2:
ErrorException: Non-static method RainLab\Sitemap\Handlers\SitemapHandler::sitemap() should not be called statically in /vendor/laravel/framework/src/Illuminate/Routing/Route.php:197
OC version 476.
Old version (v1.0.6) is available on the official market, please update the plugin.
Just wanted to let you know that translated URLs are not shown properly.
Based on the language selection it shows either the standard language or the translated language URLs but not both of them.
Hello! I tried to add custom url or page to sitemap but file still empty...
It seems that Save on Sitemap doesn't work with last build 293. I tried to uninstall & install fresh and also tried Force Update. Error:
Call stack:
exception 'Exception' with message 'Unexpected type of array, should attribute "items" be jsonable?' in /www/vendor/october/rain/src/Database/Model.php:1110
Stack trace:
#0 /www/vendor/october/rain/src/Database/Model.php(1151): October\Rain\Database\Model->saveInternal(Array)
#1 /www/modules/backend/behaviors/FormController.php(261): October\Rain\Database\Model->save(NULL, 'YXAiDGNoZtoeLOu...')
#2 [internal function]: Backend\Behaviors\FormController->update_onSave('1')
#3 /www/vendor/october/rain/src/Extension/ExtendableTrait.php(311): call_user_func_array(Array, Array)
#4 /www/vendor/october/rain/src/Extension/Extendable.php(44): October\Rain\Extension\Extendable->extendableCall('update_onSave', Array)
#5 [internal function]: October\Rain\Extension\Extendable->__call('update_onSave', Array)
#6 [internal function]: RainLab\Sitemap\Controllers\Definitions->update_onSave('1')
#7 /www/modules/backend/classes/Controller.php(527): call_user_func_array(Array, Array)
#8 /www/modules/backend/classes/Controller.php(423): Backend\Classes\Controller->runAjaxHandler('onSave')
#9 /www/modules/backend/classes/Controller.php(233): Backend\Classes\Controller->execAjaxHandlers()
#10 /www/modules/backend/classes/BackendController.php(95): Backend\Classes\Controller->run('update', Array)
#11 [internal function]: Backend\Classes\BackendController->run('rainlab/sitemap...')
Hi, thanks for this plugin.
I used it to generate my sitemap, but it lists also the items that are disabled. I'd prefer that it is not displayed to search engines.
To reproduce :
I tried to add a condition in the macro, but the Page finder item doesn't return the proper tailor item.
It returns the same strange item for all entries, with a slug equivalent to "my-collection", not the real slug, not the true item data, and not the correct is_enabled value.
I don't know how to go further. Can you help ?
When use "All static pages" type
If static page is Hidden in navigation
, than it and all childs will not appear in sitemap.
If static page is Hidden
and not Hidden in navigation
, than it will appear in sitemap.
I think only Hidden
parameter should affect visibility of static pages in sitemap, and it should not affect childs.
Referencing issue #41 because I'm also having a problem with the /sitemap.xml
returning 404 status code even though it exists.
Sitemap |
---|
URL: https://october-news.com/sitemap.xml |
Might have to force a 200 status code in the response.
Lines 20 to 22 in 41fdc43
Hi,
Even though the sitemap is live, an error displays citing a 404. I submitted to Google's Webmaster and it too also displays a 404 error.
Hello,
I tried out the plugin and I would like to add an item related to all blog categories. I have a cms page that shows all blog entries from rainlab - blog. But this page is not in the CMS Page dropdown. Are there some configuration I missed?
Thanks
Rob
The text output that shows in the top of the sitemap is:
// Catch errors if signal is already set by user agent or other extension try { Object.defineProperty(navigator, 'globalPrivacyControl', { value: false, enumerable: true }) // Remove script tag after execution document.currentScript.parentElement.removeChild(document.currentScript) } catch (e) {}
Trying to update from 1.0.1 to 1.0.9.
And here's the bug showing after a few seconds.
Update failed
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'rainlab_sitemap_definitions' already exists (SQL: create table rainlab_sitemap_definitions
(id
int unsigned not null auto_increment primary key, theme
varchar(65535) null, data
mediumtext null, created_at
timestamp null, updated_at
timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci engine = InnoDB)
Trying again doesn't help at all, same error shows up. Tried also to remove the table, and this showed up:
Update failed
SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'theme' used in key specification without a key length (SQL: alter table rainlab_sitemap_definitions
add index rainlab_sitemap_definitions_theme_index
(theme
))
Hello,
We have the sitemap plugin installed for a few years now in our website. But recently it started behaving weirdly. The error shown in the below screenshot appears very regularly.
Once we open the sitemap menu/link from the settings section, we will be able to see the sitemap.xml file correctly. But after some 3 to 4 hours of time again it will display the same error as shown in the first screenshot.
After accessing the sitemap page from the settings section. It will revert back to normal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.