$site
The $site object is the root element for any site with pages. It represents the main content folder with its site.txt.
- 
		
			new Site()
 - 
		
			$site->audio()
 - 
		
			$site->blueprint()
 - 
		
			$site->blueprints()
 - 
		
			$site->breadcrumb()
 - 
		
			$site->changeStorage()
 - 
		
			$site->changeTitle()
 - 
		
			$site->children()
 - 
		
			$site->childrenAndDrafts()
 - 
		
			$site->clone()
 - 
		
			$site->code()
 - 
		
			$site->content()
 - 
		
			$site->createChild()
 - 
		
			$site->createDefaultContent()
 - 
		
			$site->createFile()
 - 
		
			$site->decrement()
 - 
		
			$site->documents()
 - 
		
			$site->draft()
 - 
		
			$site->drafts()
 - 
		
			$site->errorPage()
 - 
		
			$site->errorPageId()
 - 
		
			$site->errors()
 - 
		
			$site->exists()
 - 
		
			$site->file()
 - 
		
			$site->files()
 - 
		
			$site->find()
 - 
		
			$site->findPageOrDraft()
 - 
		
			$site->grandChildren()
 - 
		
			$site->hardcopy()
 - 
		
			$site->hasAudio()
 - 
		
			$site->hasChildren()
 - 
		
			$site->hasCode()
 - 
		
			$site->hasDocuments()
 - 
		
			$site->hasDrafts()
 - 
		
			$site->hasFiles()
 - 
		
			$site->hasImages()
 - 
		
			$site->hasListedChildren()
 - 
		
			$site->hasMethod()
 - 
		
			$site->hasUnlistedChildren()
 - 
		
			$site->hasVideos()
 - 
		
			$site->homePage()
 - 
		
			$site->homePageId()
 - 
		
			$site->id()
 - 
		
			$site->image()
 - 
		
			$site->images()
 - 
		
			$site->increment()
 - 
		
			$site->index()
 - 
		
			$site->inventory()
 - 
		
			$site->is()
 - 
		
			$site->isValid()
 - 
		
			$site->kirby()
 - 
		
			$site->lock()
 - 
		
			$site->mediaDir()
 - 
		
			$site->mediaRoot()
 - 
		
			$site->mediaUrl()
 - 
		
			$site->modified()
 - 
		
			$site->page()
 - 
		
			$site->pages()
 - 
		
			$site->panel()
 - 
		
			$site->permissions()
 - 
		
			$site->previewUrl()
 - 
		
			$site->purge()
 - 
		
			$site->query()
 - 
		
			$site->root()
 - 
		
			$site->save()
 - 
		
			$site->search()
 - 
		
			$site->site()
 - 
		
			$site->storage()
 - 
		
			$site->toArray()
 - 
		
			$site->toSafeString()
 - 
		
			$site->toString()
 - 
		
			$site->translation()
 - 
		
			$site->translations()
 - 
		
			$site->update()
 - 
		
			$site->url()
 - 
		
			$site->uuid()
 - 
		
			$site->version()
 - 
		
			$site->versions()
 - 
		
			$site->videos()
 - 
		
			$site->visit()
 - 
		
			$site->wasModifiedAfter()
 
How to access the $site object
The $site variable is automatically available in your templates and snippets.
To access the $site object in extensions, you have to define it first:
// via the kirby object
$site = $kirby->site();
// using the `site()` helper
$site = site();
Examples
Get the site title
echo $site->title();
Get any custom field of the site
echo $site->description();
Get the files stored in the content folder
$siteFiles = $site->files();
Get all the pages of the site
$pageIndex = $site->index();
Get the URL of the site
$url = $site->url();