Skip to content

Collection Examples

Johan Janssens edited this page Jun 10, 2019 · 14 revisions

Table of contents

RSS feed

Joomlatools Pages has a built-in template for RSS feeds. To create your own feed, create a page for the feed and import the built-in template and define the collection for the pages you want to have included in the feed.

For example, to create a feed of all blog posts in the /pages/blog directory add following page /pages/blog/index.rss.php

---
title: My Site Blog 
summary: There's lots happening on my site, our blog will keep you up-to-date.
collection:
   state:
        path: blog
        recurse: false
        limit: 20
        sort: date
        order: desc
        collection: false
visible: false
---

<?= import('com:pages.pages.newsfeed.rss'); ?>

XML Sitemap

Joomlatools Pages has a built-in template for sitemaps. To create your own sitemap, all you need to do is create a page for the sitemap, import the built-in template and define the collection for the pages you want to have included in the sitemap.

For example, to create a sitemap of all pages in your site, add following page /pages/sitemap.xml.php

---
title: Sitemap
collection:
    state:
        path: .
        limit: 0
        sort: date
        order: desc
        recurse: false
visible: false
---

<?= import('com:pages.pages.sitemap.xml'); ?>

Adding pages to the sitemap

By default, all pages will be added to the sitemap. To exclude a certain page from the sitemap, simply add robots: [noindex] to the page's frontmatter.

---
title: My Page
metadata:
    robots: [noindex]
---
Clone this wiki locally