Git Product home page Git Product logo

sitemap-plugin's People

Contributors

acasar avatar anik1ng avatar blazorazem avatar daftspunk avatar diraulo avatar emzet avatar gergo85 avatar jh2odo avatar lemax10 avatar luketowers avatar magiczne avatar mahony0 avatar matissjanis avatar mjauvin avatar mohsin avatar mr118 avatar octoberapp avatar raank avatar ribsousa avatar samgeorges avatar samuell1 avatar theservat avatar vojtasvoboda avatar zek avatar zhiweiwu0425 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sitemap-plugin's Issues

Sitemap is empty, changes aren't saved

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.
grafik

I read the other issues with the same problem, but I couldn't find a working solution.

Implement urls with the language tag

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

Fails if php-xml not installed

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.

Undefined index:

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.

[ERROR] Site Definition Error

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.

Is it possible to use custom post types (automatically) in the sitemap plugin?

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.

wrong content type

Hi,

My sitemap returns HTML content type instead of XML with the last build (224). Maybe a wrong ngix conf ?

Error on sitemap.xml

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

Incorrectly lists the URLs for unpublished blog posts in the sitemap

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.

Show dynamic parameters for pages where are used models made in Builder plugin

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.

Maximum function nesting level error when building a sitemap with all static pages

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.

Incorrect Sitemap generation

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.

Rendering of empty pages

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?

Easier way to implement custom itemTypes

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:

  • Use a behavior to define the standard functions like resolveMenuItem etc
  • User has to add fields to the model for the needed input that varies for each itemType.
$itemType = 'blog-post';
$componentName = 'blogPost';
$scope = `isVisible`;

Hurdles I can think of:

  • Combining singular and multiple item logic (blog-post vs all-blog-posts)
  • Combining multiple itemtypes in 1 model (blog-post / category etc)

Does anyone have any input into this matter?

Add support for multiple sitemaps, per theme

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>

Disabled plugin still renders /sitemap.xml

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

URL rendering default instead of category in path

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?

sitemap.xml is empty?

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?

Can't create new sitemap

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?

XML declaration allowed only at the start of the document

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.

Restrict User Access

It could be really nice if you can add permissions.

Any user can access it in backend.

Sitemap won't open, instead downloads source file

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:

image

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.

Extend / Override plugin

<?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

No sitemap definition was found

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.

Reordering feature not working properly

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

SitemapHandler::sitemap() should not be called statically

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.

Does not work with properly with translated URLs

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.

Empty sitemap.xml

Hello! I tried to add custom url or page to sitemap but file still empty...

Doesn't work with last build

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:

snimek obrazovky 2015-09-08 v 11 11 56

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...')

The sitemap shows disabled pages

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 :

  • Create a tailor collection
  • Add several items
  • Publish some, leave others disabled (is_enabled = false)
  • Create a page to display the item with the url scheme "my-collection/:slug"
  • Create the sitemap entry to list All these entries

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 ?

Hidden static pages

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.

cms page - no matches found

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

Seeing output I don't believe should render at the top of the output xml file

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) {}

Software updating problem, database (MariaDB) doesn't want to update

Trying to update from 1.0.1 to 1.0.9.

image

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))

Error while accessing sitemap.xml

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.
sitemap-error

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.
image

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.