$page->hasDocuments()

Checks if there are any documents (pdf, doc, xls, etc.) in the page's directory

  • return (integer)

Example

<?php
echo $page->hasDocuments(); //returns the number of documents in the folder

if($page->hasDocuments()) {
  $documents = $page->documents();
}
?>