getformwork / formwork

🏗 A flat file-based Content Management System (CMS) to build and manage sites with simplicity
MIT License
52 stars 12 forks source link

Site Path #524

Closed Wemago closed 5 months ago

Wemago commented 5 months ago

Shouldn't $site->path() return the site folder path? Currently it's returning site content folder path.

giuscris commented 5 months ago

This is because $site actually represents the content root, and so page traversal is allowed even if the page parent is a Site object. If you call $page->parent()->path() you have the expected result.

Maybe the naming could be reviewed in Formwork 2.0, splitting Site from pages logic for good and also the content folder should be renamed to "pages".

I'm not afraid of breaking changes, as Formwork 1.0 is almost entirely rewritten.