Git Product home page Git Product logo

cakephp-sitemap's People

Contributors

davidyell avatar elboletaire avatar justinyost avatar kriskd avatar ricog avatar

Stargazers

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

cakephp-sitemap's Issues

Preventing Duplicate Pages

Sorry for the next issue.

Say I have 100 pages with the slug keyword of "potatoes"

When I run the sitemap there are 100 of these in the sitemap, how would I limit it to unique entries only?

Problem with XML file when PHP short tag is enabled

Hi!

I found problem in index.ctp (/loadsys/cakephp_sitemap/src/Template/Sitemaps/xml/index.ctp).

The XML file report 500 error in first line because on my host PHP short tags is enabled.

I have simple solution because I can't off short tags on my host. Put it below.

BEFORE
<?xml version="1.0" encoding="UTF-8"?>

AFTER
<?= '<?xml version="1.0" encoding="UTF-8"?>'; ?>

Package Using

I started to work with Cake PHP new. This package has insufficient usage documentation. I could not run the sample code shown. Is there anything that can help me with this? Cake PHP version 3.x

Thank you.

How to call the sitemap.xml

I used the Docs to install and configure it. My very simple Question is how to view it, the Plugin/config/routes.php let me guess it is Domain/sitemap oder /sitemap.xml , but this just shows:

Documentation API
Error: SitemapController could not be found.

Error: Create the class SitemapController below in file: src/Controller/SitemapController.php

Auth and template questions

Hello,

I'm trying to implement your plugin with some modifications in layout and also I want to enable it for the users who are not authenticated.

1. Auth allowing
If I put the beforeFilter function to the Sitemap plugin's controller -SitemapsController.php- and I define that the index action should be allowed for all unauthorized users...

public function beforeFilter(Event $event)
    {
        $this->Auth->allow(
            'index'
        );

        return parent::beforeFilter($event);
    }

...then it works correctly. But of course I don't want to modify the files in the vendor folder, so my questions is: Is there a way to set this in my application? I tried to put this to my AppController.php:

$this->Auth->allow(
            'Sitemap.index'
        );

But it doesn't seems to work.

2. Custom template
I read and tried to implement this according to the official CakePHP docs, but obviously I'm doing something wrong. I tried different paths, but they all failed:

src/Template/Plugin/loadsys/Sitemap/Sitemaps/xml/index.ctp
src/Template/Plugin/loadsys/Cakephp_sitemap/Sitemaps/xml/index.ctp
src/Template/Plugin/Loadsys/Cakephp_sitemap/Sitemaps/xml/index.ctp
src/Template/Plugin/Loadsys/CakephpSitemap/Sitemaps/xml/index.ctp

Of course, non of these worked.

Changing URL's from Default

Hi,

I use this code to generate my links:

Router::connect(
'/offers/:slug-:id',
array('controller' => 'offers', 'action' => 'view'),
array(
'pass' => array('id', 'slug'),
'id' => '[0-9]+'
));

Basically it works by going /offers/this-is-a-link-66

At the minute all my sitemap shows is

/offers/view/226

How would I go about changing it? I think it would be this line :

'loc' => 'buildUrl'

Update Packagist package name?

To follow convention, this package should probably be named loadsys/cakephp-sitemap.

This might have an impact on package consumers and warrants further consideration before implementing.

Missing Docu

I installed the plugin via composer - added the behavior etc.

I am missing the docu how to view any of this. Could you add this to the readme?

Compress sitemap to gz

It would be awesome if this plugin could also generate the compressed version of the sitemap (sitemap.xml.gz).

error Router

Hi ad,
I has add Sitemap plugin into my site,
I can generate site map success, but all router on my site become error
after i add your plugin i still can access site /controller/action/param
but Router not working for me
If i remove your plugin then Router working ok for me
Please confirm this issues!

Move Iterators from Vendor/ to Lib/ folder.

Given our recent uptick of composer usage, the Vendor directory is increasingly becoming a location that should be "hands off."

I suggest moving the Vendor/Iterators/ folder to Lib/Iterators/ in order to avoid future conflicts.

CakePHP installation issue

Got this exception trying to install on CakePHP 3.2+
`Generating autoload files

Cake\Composer\Installer\PluginInstaller::postAutoloadDump
Script Cake\Composer\Installer\PluginInstaller::postAutoloadDump handling the post-autoload-dump event terminated with an exception
Installation failed, reverting ./composer.json to its original content.
[RuntimeException]
Unable to get primary namespace for package loadsys/cakephp_sitemap.
Ensure you have added proper 'autoload' section to your plugin's config as
stated in README on https://github.com/cakephp/plugin-installer

`
Is there any way to fix this ?

Working with plugin tables

It seems the plugin has some trouble loading table classes from plugins. There also isn't a test case for this.

I configured as follows,

Configure::write('Sitemap.tables', [
    'Gaia/Matter.Contents'
]);

Yet, when I hit /sitemap.xml I get the following.

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <message>Call to a member function find() on boolean</message>
  <url>/sitemap.xml</url>
  <code>500</code>
  <file>/vendor/loadsys/cakephp_sitemap/src/Controller/SitemapsController.php</file>
 <line>29</line>
</response>

I think the issue is the way that the loaded table instance is used based on the string of the table name. As plugin and namespaced table names are aliased differently.

I'll see if I can solve it and submit a pull request.

Add handpicked results

It would be very nice to have an option to add hand-picked links. In my case, the home page does not directly depend from an entity and I would like to add it to the generated sitemap.xml file.

I guess that using an array in the Sitemap configuration like this one:

'handpicked' => [
  [
    'route' => ['_name' => 'my_route'],
    'changefreq' => 'weekly',
    'priority' => 0.7
  ]
]

Modify routes

$routes->extensions(['xml']);

For >

$routes->setExtensions(['xml']);

Update composer package name?

Excluding the loadsys_codesniffer (which must avoid dashes in the filesystem path), our Packagist packages follow a naming convention of using dashes in the package name: https://packagist.org/packages/loadsys/

It would only be a superficial improvement to convert the name to match and might cause problems for any consuming projects (are there any that we should be concerned with) to change the package name.

Only if the impact is low would this be worth doing after the fact (now).

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.