Everything you need to access the pages stored in the database can be found on the `Documentation::Page` model. ## Finding pages In most cases, you'll want to find a page based on its path from the root of the site, for example, `example/page/here` may be the string you want to use to find the `here` page. ```ruby page = Documentation::Page.find_from_path('example/page/here') ``` ## Useful page methods Once you've found a page, there are a number of methods & attribute which may be useful to you. * `title` - the page's title * `content` - the markdown content for a page * `compiled_content` - the HTML content for a page * `parents` - returns an array of all the parents for the page * `breadcrumb` - returns the items which should be included in a breadcrumb trail * `full_permalink` - the full permalink including all parents * `children` - all child pages for the page * `has_children?` - whether or not the page has children * `navigation` - appropriate navigation pages for this page ## Searching If you wish to search pages, you should use the `Documentation::Page.search` method as shown below: ```ruby result = Documentation::Page.search('query here', :page => 1) ``` Once you have a result object, you can use this to get information about the pages which matched the result. The following methods may be useful: * `results` - the pages which have been found * `excerpt_for(page)` - an excerpt to display for this page * `empty?` - was the search empty? * `total_pages` - the total number of pagination pages