contao/test — Issue #2820: Small change request to Backend->findSearchablePages()
Author: importer
Created: 2011-11-29 10:22:52+00:00
State: open
Labels: backend, Feature

I noticed that the way I structure my sites sometimes makes it impossible for the Sitemap and findSearchablePages function to work correctly. I usually group my navigation structures like this:

Root Web
* Home
* Main Nav (unpublished)
> * Nav 1
> * Nav 2
* Footer Nav (unpublished)
> * Top Nav 1
> * Top Nav 2

What that does is essentially only pull the home page when generating my sitemap because the findSearchablePages() function is initially only looking for published pages under the root and their subsequent subpages: (line 253 from Backend.php)

`$objPages = $this->Database->prepare("SELECT * FROM tl_page WHERE pid=? AND (start='' OR start<$time) AND (stop='' OR stop>$time) AND published=1 ORDER BY sorting")`

Since we are checking a few lines down (line 292) about whether the page is published anyhow, it seems like we should include all pages at the initial level.

Yes, I realize this will cause a debate about whether pages in a tree structure whose parent page is not published should be included, but I find that setting my sites up in pseudo-folders this way keeps them organized and easy to manage. Plus, after the first level it would be doing the same thing anyways in subsequent loops (including all pages and just checking for published status).

Hope this provides enough info.

--- _Originally created by winanscreative on January 21st, 2011, at 09:03pm (ID 2820)_