Module: RailsConnector::SEO::ClassMethods

Defined in:
lib/rails_connector/seo.rb

Overview

The methods contained herein are attached to the Obj model class.

Instance Method Summary collapse

Instance Method Details

#find_all_for_sitemapObject

Finds all objects that shall be included in the SEO sitemap.xml. On each exportable none-image object, InstanceMethods#included_in_seo_sitemap? is called. Overwrite included_in_seo_sitemap? in your Obj to adjust the criteria.



13
14
15
16
17
18
19
# File 'lib/rails_connector/seo.rb', line 13

def find_all_for_sitemap
  start = Obj.homepage
  children = start.toclist
  grandchildren = children.map(&:toclist).flatten

  ([start] + children + grandchildren).select(&:included_in_seo_sitemap?)
end