I am trying to generate a sitemap.xml file of all the pages that are published to the Broker. Can this be achieved if I use the content delivery API? Can I recursively traverse through the SGs and pages to get the URL of the page?
How to recursivly traverse through SG's and pages using Content delivery API?
There is a good article by Nickoli Roussakov (http://www.tridiondeveloper.com/web-sitemap) that pretty much gives you the code you need to generate a sitemap file by traversing through SGs and Pages. You simply need to add a TBB to your Page Template which will generate your sitemap.
However, in most cases, business rules tend to handle other logic through Page or SG Metadata which can be appended as attributes to each siteMapNode. But, to do this you will need to extend the code to meet your needs.
On a side note, I'd just like to add (depending on the amount of SGs and Pages you have), the sitemap xml file could become really large, becoming quite time consuming to publish as you will be updating the file on every publish/unpublish. Assuming you haven't yet decided on an approach to take, I would have a read of this post (https://tridion.stackexchange.com/questions/381/what-are-the-best-practices-to-manage-the-sitemap-for-a-tridion-website) which discusses alternative ways to generate a sitemap.
- WordPress questions and answers
- SharePoint questions and answers
- Drupal questions and answers
- Magento questions and answers
- Salesforce questions and answers
- Joomla questions and answers
- Tridion questions and answers
- Craft CMS questions and answers
- CiviCRM questions and answers
- Sitecore questions and answers