承接 elefant/app-sitemap.xml 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elefant/app-sitemap.xml

Composer 安装命令:

composer require elefant/app-sitemap.xml

包简介

Google Sitemap generator app for the Elefant CMS

README 文档

README

This is a Google Sitemaps generator for Elefant CMS powered websites.

To use, install it into your apps folder as sitemap.xml, then point Google Webmaster Tools to the URL /sitemap.xml on your site. On the first request it will generate a sitemap file for your site.

Additional info:

  • The generated site map will be cached for 24 hours by default. To change this, edit apps/sitemap.xml/conf/config.php.
  • To reset the cache early, log into Elefant and go to Tools > Google Sitemaps and click the reset link.
  • The site map will include all public pages, published blog posts, and events (if the events app is installed).

Troubleshooting

If your sitemap link (e.g., /sitemap.xml) generates a blank response, make sure you have PHP's short_open_tag setting disabled and restart your web server. This causes <?xml tags to create PHP parse errors. Note that this is different than the <?= shortened tags that are always enabled in PHP 5.4+.

Adding URLs from your custom apps

Just create a static method call on your models that returns an array of URLs you want to include in the site map, and add a line in your app's conf/config.php in the [Admin] section like this:

sitemap = "myapp\MyModel::sitemap"

Here's a sample model for the above:

<?php

namespace myapp;

class MyModel extends \Model {
	public $table = 'myapp_mymodel';

	public static function sitemap () {
		$res = self::query ()
			->where ('published', 'yes')
			->fetch_orig ();
	
		$urls = array ();
		foreach ($res as $item) {
			$urls[] = '/myapp/item/' . $item->id . '/' . \URLify::filter ($item->title);
		}
		return $urls;
	}
}

?>

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-05-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固