{"id":20312497,"url":"https://github.com/kokspflanze/zfcsitemap","last_synced_at":"2025-04-11T16:51:31.226Z","repository":{"id":52419324,"uuid":"154051654","full_name":"kokspflanze/ZfcSitemap","owner":"kokspflanze","description":"Sitemap for Laminas","archived":false,"fork":false,"pushed_at":"2023-06-26T12:26:42.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T01:32:17.524Z","etag":null,"topics":["navigation","php","php7","sitemap","zend-framework","zf3"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kokspflanze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-21T20:57:54.000Z","updated_at":"2021-04-29T19:42:01.000Z","dependencies_parsed_at":"2022-09-04T11:01:40.772Z","dependency_job_id":null,"html_url":"https://github.com/kokspflanze/ZfcSitemap","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokspflanze%2FZfcSitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokspflanze%2FZfcSitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokspflanze%2FZfcSitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kokspflanze%2FZfcSitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kokspflanze","download_url":"https://codeload.github.com/kokspflanze/ZfcSitemap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248443030,"owners_count":21104324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["navigation","php","php7","sitemap","zend-framework","zf3"],"created_at":"2024-11-14T18:06:27.686Z","updated_at":"2025-04-11T16:51:31.203Z","avatar_url":"https://github.com/kokspflanze.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZfcSitemap Module for Laminas\n\n## SYSTEM REQUIREMENTS\n\n- requires PHP 7.1 or later; we recommend using the latest PHP version whenever possible.\n- you have to use `laminas-navigation`\n\n## INSTALLATION\n\n### Composer\n\nInstallation of this module uses composer. For composer documentation, please refer to\n[getcomposer.org](http://getcomposer.org/).\n\n```sh\nphp composer.phar require kokspflanze/zfc-sitemap\n# (When asked for a version, type `dev-master`)\n```\n\nGo to `config/application.config.php` and add `ZfcSitemap` in the modules section.\n\n## How to use\n\n### Get the sitemap\n\nyou can see your current sitemap with `/sitemap.xml`\n\n### Create a sitemap as cache (optional)\n\nThis create a sitemap in `data/zfc-sitemap` as cache, this means, if you call `/sitemap.xml` it will not longer create a new sitemap, it will use the cached sitemap.\n\nFor this you need to install `laminas/laminas-mvc-console` and this directory `data/zfc-sitemap` with write rights.\n\nThan you can execute  `php public/index.php generate-sitemap http://example.com` to create your sitemap.\nPS: You have to rerun it to create a new sitemap.\n\n### Change your sitemap\n\nIf you have dynamic pages on your page and you want to add them in the sitemap. You can add them with the EventManager.\n\n#### Create a listener\n\ncreate a new class\n\n````php\n\u003c?php\n\nnamespace App\\Core\\Listener;\n\nuse Laminas\\EventManager;\nuse Laminas\\Navigation\\AbstractContainer;\nuse ZfcSitemap\\Service\\Sitemap;\n\nclass SitemapCustom extends EventManager\\AbstractListenerAggregate\n{\n    /**\n     * @inheritDoc\n     */\n    public function attach(EventManager\\EventManagerInterface $events, $priority = 1)\n    {\n        $this-\u003elisteners[] = $events-\u003eattach(Sitemap::EVENT_SITEMAP, [$this, 'onSiteMap'], $priority);\n    }\n\n    /**\n     * @param EventManager\\EventInterface $event\n     */\n    public function onSiteMap(EventManager\\EventInterface $event)\n    {\n        /** @var AbstractContainer $container */\n        $container = $event-\u003egetParam('container');\n\n        $container-\u003eaddPage([\n            'label' =\u003e 'Example',\n            'uri' =\u003e '/example',\n        ]);\n        /**\n        *  your custom stuff, add or remove pages\n         */\n\n        $event-\u003esetParam('container', $container);\n    }\n\n}\n````\n\nThan you have to add your listener in the `service_manager` config and in the following configuration.\n\n````php\n    'zfc-sitemap' =\u003e [\n        'strategies' =\u003e [\n            Listener\\SitemapCustom::class,\n        ],\n    ],\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokspflanze%2Fzfcsitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkokspflanze%2Fzfcsitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkokspflanze%2Fzfcsitemap/lists"}