├── storage └── .gitkeep ├── .gitignore ├── assets ├── folder.yaml ├── examples │ ├── folder.yaml │ ├── navigation.png │ ├── cascade-post.jpg │ ├── session-dump.png │ ├── password-fieldtype.gif │ └── pagination-auto-links.png ├── fieldtypes │ ├── folder.yaml │ ├── array.png │ ├── assets.png │ ├── bard.gif │ ├── date.png │ ├── grid.png │ ├── hidden.gif │ ├── hidden.png │ ├── list.png │ ├── pages.png │ ├── radio.png │ ├── relate.png │ ├── select.jpg │ ├── table.gif │ ├── tags.jpg │ ├── text.jpg │ ├── time.gif │ ├── toggle.gif │ ├── users.jpg │ ├── video.jpg │ ├── yaml.jpg │ ├── fieldset.png │ ├── markdown.png │ ├── redactor.png │ ├── revealer.gif │ ├── section.jpg │ ├── suggest.jpg │ ├── taxonomy.jpg │ ├── template.jpg │ ├── textarea.jpg │ ├── checkboxes.png │ ├── collection.png │ ├── collections.png │ └── replicator.jpg └── img │ ├── other │ ├── bacon.jpg │ ├── cp-assets.png │ ├── breadcrumbs.png │ ├── assets-manager.png │ ├── assets-filetypes.png │ ├── cp-asset-manager.png │ └── cp-asset-fieldtype.png │ ├── screenshots │ ├── cli.png │ ├── cp-forms.jpg │ ├── cp-forms.png │ ├── cp-login.jpg │ ├── cp-assets.png │ ├── cp-metrics.jpg │ ├── cp-settings.jpg │ ├── debug-bar.png │ ├── performance.png │ ├── read-only.jpg │ ├── cp-collection.png │ ├── cp-page-tree.jpg │ └── cp-update-available.png │ └── trail-guides │ ├── addon.jpg │ ├── debug.jpg │ ├── forms.jpg │ ├── l10n.png │ ├── urls.jpg │ ├── assets.jpg │ ├── caching.jpg │ ├── search.jpg │ ├── theming.jpg │ ├── taxonomies.jpg │ ├── upgrading.jpg │ ├── yaml-101.jpg │ ├── nice-assets.jpg │ ├── permissions.jpg │ ├── content-types.jpg │ ├── getting-started.jpg │ └── template-language.jpg ├── content ├── assets │ └── main.yaml ├── pages │ ├── 7.addons │ │ ├── folder.yaml │ │ └── 9.api │ │ │ ├── deprecations │ │ │ └── index.md │ │ │ └── index.md │ ├── knowledge-base │ │ └── index.md │ ├── 1.tags │ │ └── index.md │ ├── 3.modifiers │ │ └── index.md │ └── index.md ├── taxonomies │ ├── types.yaml │ ├── kb_categories.yaml │ └── kb_categories │ │ ├── how-to.yaml │ │ └── troubleshooting.yaml ├── collections │ ├── classes │ │ ├── folder.yaml │ │ ├── pagefactory.md │ │ ├── globalfactory.md │ │ ├── api-role.md │ │ ├── termfactory.md │ │ ├── api-taxonomy.md │ │ ├── api-globalset.md │ │ ├── userfactory.md │ │ ├── term.md │ │ ├── api-page.md │ │ └── api-term.md │ ├── deprecations │ │ └── folder.yaml │ ├── events │ │ ├── folder.yaml │ │ ├── deprecated-system-updated.md │ │ ├── page-saved.md │ │ ├── user-saved.md │ │ ├── role-saved.md │ │ ├── term-saved.md │ │ ├── entry-saved.md │ │ ├── page-deleted.md │ │ ├── user-deleted.md │ │ ├── globals-saved.md │ │ ├── role-deleted.md │ │ ├── term-deleted.md │ │ ├── asset-deleted.md │ │ ├── asset-moved.md │ │ ├── entry-deleted.md │ │ ├── taxonomy-saved.md │ │ ├── asset-uploaded.md │ │ ├── fieldset-saved.md │ │ ├── globals-deleted.md │ │ ├── user-group-saved.md │ │ ├── asset-replaced.md │ │ ├── taxonomy-deleted.md │ │ ├── collection-saved.md │ │ ├── fieldset-deleted.md │ │ ├── submission-saved.md │ │ ├── user-group-deleted.md │ │ ├── asset-folder-saved.md │ │ ├── collection-deleted.md │ │ ├── submission-deleted.md │ │ ├── asset-folder-deleted.md │ │ ├── settings-saved.md │ │ ├── file-uploaded.md │ │ ├── asset-container-deleted.md │ │ ├── addon-settings-saved.md │ │ ├── user-registered.md │ │ ├── cp-add-to-head.md │ │ ├── search-query-performed.md │ │ ├── form-submission.created.md │ │ ├── cp-nav-created.md │ │ ├── glide-generated.md │ │ ├── asset-container-saved.md │ │ ├── pages-moved.md │ │ ├── deprecated-content-saved.md │ │ ├── statamic-updated.md │ │ ├── page-moved.md │ │ ├── response-created.md │ │ ├── cp-published.md │ │ ├── finding-fieldset.md │ │ ├── stache-updated.md │ │ └── content-deleted.md │ ├── docs │ │ ├── console.md │ │ ├── folder.yaml │ │ ├── managing-users-in-the-cp.md │ │ ├── managing-content-in-the-cp.md │ │ └── tour.md │ ├── modifiers │ │ ├── folder.yaml │ │ ├── piped.md │ │ ├── singular.md │ │ ├── surround.md │ │ ├── ceil.md │ │ ├── floor.md │ │ ├── is_weekday.md │ │ ├── swap_case.md │ │ ├── lcfirst.md │ │ ├── count.md │ │ ├── is_weekend.md │ │ ├── ucfirst.md │ │ ├── upper.md │ │ ├── is_json.md │ │ ├── segment.md │ │ ├── backspace.md │ │ ├── is_numberwang.md │ │ ├── to_spaces.md │ │ ├── url.md │ │ ├── repeat.md │ │ ├── word_count.md │ │ ├── at.md │ │ ├── last.md │ │ ├── to_tabs.md │ │ ├── first.md │ │ ├── is_blank.md │ │ ├── lower.md │ │ ├── deslugify.md │ │ ├── insert.md │ │ ├── link.md │ │ ├── has_lower_case.md │ │ ├── has_upper_case.md │ │ ├── is_past.md │ │ ├── is_future.md │ │ ├── is_lowercase.md │ │ ├── trim.md │ │ ├── is_url.md │ │ ├── urldecode.md │ │ ├── urlencode.md │ │ ├── is_uppercase.md │ │ ├── nl2br.md │ │ ├── favicon.md │ │ ├── list.md │ │ ├── round.md │ │ ├── image.md │ │ ├── ol.md │ │ ├── divide.md │ │ ├── regex_replace.md │ │ ├── ul.md │ │ ├── is_email.md │ │ ├── remove_left.md │ │ ├── is_yesterday.md │ │ ├── replace.md │ │ ├── tidy.md │ │ ├── cdata.md │ │ ├── console_log.md │ │ ├── ends_with.md │ │ ├── is_numeric.md │ │ ├── ampersand_list.md │ │ ├── background_position.md │ │ ├── contains_any.md │ │ ├── length.md │ │ ├── option_list.md │ │ ├── ascii.md │ │ ├── is_leap_year.md │ │ ├── remove_right.md │ │ ├── sentence_list.md │ │ ├── sanitize.md │ │ ├── starts_with.md │ │ ├── mailto.md │ │ ├── explode.md │ │ ├── add.md │ │ ├── ensure_right.md │ │ ├── is_today.md │ │ ├── unique.md │ │ ├── is_between.md │ │ ├── collapse.md │ │ ├── dashify.md │ │ ├── multiply.md │ │ ├── rawurlencode.md │ │ ├── contains_all.md │ │ ├── collapse_whitespace.md │ │ ├── reverse.md │ │ ├── days_ago.md │ │ ├── ensure_left.md │ │ ├── substr.md │ │ ├── hours_ago.md │ │ ├── weeks_ago.md │ │ ├── years_ago.md │ │ ├── months_ago.md │ │ ├── mod.md │ │ ├── read_time.md │ │ ├── seconds_ago.md │ │ ├── shuffle.md │ │ ├── subtract.md │ │ ├── gravatar.md │ │ ├── is_alpha.md │ │ ├── underscored.md │ │ ├── camelize.md │ │ ├── pad.md │ │ ├── textile.md │ │ ├── is_alphanumeric.md │ │ ├── dump.md │ │ ├── markdown.md │ │ ├── is_after.md │ │ ├── minutes_ago.md │ │ ├── join.md │ │ ├── title.md │ │ ├── slugify.md │ │ ├── to_json.md │ │ ├── entities.md │ │ ├── format_number.md │ │ ├── sum.md │ │ ├── group_by.md │ │ ├── is_empty.md │ │ ├── obfuscate.md │ │ ├── spaceless.md │ │ ├── dl.md │ │ ├── is_before.md │ │ ├── format.md │ │ ├── obfuscate_email.md │ │ ├── decode.md │ │ ├── where.md │ │ ├── get.md │ │ ├── yes_no.md │ │ ├── flatten.md │ │ ├── is_embeddable.md │ │ ├── count_substring.md │ │ ├── merge.md │ │ ├── widont.md │ │ ├── wrap.md │ │ ├── full_urls.md │ │ ├── partial.md │ │ ├── embed_url.md │ │ ├── flip.md │ │ ├── format_localized.md │ │ ├── limit.md │ │ ├── safe_truncate.md │ │ ├── offset.md │ │ ├── as.md │ │ ├── modify_date.md │ │ ├── plural.md │ │ ├── truncate.md │ │ └── table.md │ ├── variables │ │ ├── folder.yaml │ │ ├── csrf_token.md │ │ ├── is_page.md │ │ ├── is_term.md │ │ ├── is_asset.md │ │ ├── is_entry.md │ │ ├── response_code.md │ │ ├── get_post.md │ │ ├── extension.md │ │ ├── width.md │ │ ├── height.md │ │ ├── current_uri.md │ │ ├── current_url.md │ │ ├── taxonomy.md │ │ ├── template.md │ │ ├── collection.md │ │ ├── datestring.md │ │ ├── filename.md │ │ ├── path.md │ │ ├── site_url.md │ │ ├── homepage.md │ │ ├── size_bytes.md │ │ ├── size_gigabytes.md │ │ ├── size_kilobytes.md │ │ ├── size_megabytes.md │ │ ├── url.md │ │ ├── basename.md │ │ ├── order_type.md │ │ ├── count.md │ │ ├── permalink.md │ │ ├── timestamp.md │ │ ├── is_image.md │ │ ├── published.md │ │ ├── focus_css.md │ │ ├── segment_x.md │ │ ├── size.md │ │ ├── slug.md │ │ ├── last_segment.md │ │ ├── id.md │ │ ├── environment.md │ │ ├── datestamp.md │ │ ├── order.md │ │ ├── has_timestamp.md │ │ ├── locale.md │ │ ├── date.md │ │ ├── xml_header.md │ │ ├── csrf_field.md │ │ ├── last_modified.md │ │ ├── locale_full.md │ │ ├── locale_name.md │ │ ├── locale_url.md │ │ ├── now.md │ │ ├── edit_url.md │ │ ├── focus.md │ │ ├── post.md │ │ └── get.md │ ├── tags │ │ ├── folder.yaml │ │ ├── iterate.md │ │ ├── nav-count.md │ │ ├── asset.md │ │ ├── trans_choice.md │ │ ├── pages-listing.md │ │ ├── entries-listing.md │ │ ├── taxonomy-listing.md │ │ ├── theme-partial.md │ │ ├── link.md │ │ ├── user.md │ │ ├── dump.md │ │ ├── theme.md │ │ ├── user-logout_url.md │ │ ├── nav-exists.md │ │ ├── theme-output.md │ │ ├── markdown.md │ │ ├── session-flush.md │ │ ├── session-dump.md │ │ ├── form.md │ │ ├── pages-previous.md │ │ ├── search-form.md │ │ ├── redirect.md │ │ ├── collection-previous.md │ │ ├── section.md │ │ ├── env.md │ │ ├── markdown-indent.md │ │ ├── session-forget.md │ │ ├── session-flash.md │ │ ├── user-logout.md │ │ ├── widont.md │ │ ├── 404.md │ │ ├── obfuscate.md │ │ ├── user-not_in.md │ │ └── collection-count.md │ ├── kb │ │ ├── folder.yaml │ │ ├── oauth.md │ │ ├── settings.md │ │ ├── emails.md │ │ ├── licensing.md │ │ ├── logging.md │ │ ├── reset-password.md │ │ ├── yaml-error.md │ │ ├── forge.md │ │ ├── clear-cache.md │ │ ├── mixed-content.md │ │ ├── wrong-domain.md │ │ ├── duplicate-content.md │ │ ├── homepage-only.md │ │ └── trial-mode.md │ ├── widgets │ │ ├── folder.yaml │ │ └── updater.md │ └── fieldtypes │ │ ├── folder.yaml │ │ ├── time.md │ │ ├── template.md │ │ ├── hidden.md │ │ ├── textarea.md │ │ ├── section.md │ │ ├── radio.md │ │ ├── toggle.md │ │ ├── yaml.md │ │ └── fieldset.md └── globals │ └── global.yaml ├── README.md └── .github └── CONTRIBUTING.md /storage/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /assets/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Assets 2 | -------------------------------------------------------------------------------- /assets/examples/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Examples 2 | -------------------------------------------------------------------------------- /assets/fieldtypes/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Fieldtypes 2 | -------------------------------------------------------------------------------- /content/assets/main.yaml: -------------------------------------------------------------------------------- 1 | title: Assets 2 | path: assets 3 | url: /assets 4 | -------------------------------------------------------------------------------- /content/pages/7.addons/folder.yaml: -------------------------------------------------------------------------------- 1 | parse_content: false 2 | # template: addons/page -------------------------------------------------------------------------------- /content/taxonomies/types.yaml: -------------------------------------------------------------------------------- 1 | title: Modifier Types 2 | # template: modifiers 3 | -------------------------------------------------------------------------------- /content/collections/classes/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Classes 2 | template: class 3 | language: php 4 | -------------------------------------------------------------------------------- /content/collections/deprecations/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Deprecations 2 | template: deprecation 3 | -------------------------------------------------------------------------------- /content/collections/events/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Events 2 | language: php 3 | template: event 4 | -------------------------------------------------------------------------------- /content/collections/docs/console.md: -------------------------------------------------------------------------------- 1 | title: Console 2 | id: 56c191b2-c67e-4c00-af91-c7b566d7521a 3 | -------------------------------------------------------------------------------- /content/taxonomies/kb_categories.yaml: -------------------------------------------------------------------------------- 1 | title: Knowledge Base Categories 2 | template: kb/category 3 | -------------------------------------------------------------------------------- /assets/fieldtypes/array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/array.png -------------------------------------------------------------------------------- /assets/fieldtypes/assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/assets.png -------------------------------------------------------------------------------- /assets/fieldtypes/bard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/bard.gif -------------------------------------------------------------------------------- /assets/fieldtypes/date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/date.png -------------------------------------------------------------------------------- /assets/fieldtypes/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/grid.png -------------------------------------------------------------------------------- /assets/fieldtypes/hidden.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/hidden.gif -------------------------------------------------------------------------------- /assets/fieldtypes/hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/hidden.png -------------------------------------------------------------------------------- /assets/fieldtypes/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/list.png -------------------------------------------------------------------------------- /assets/fieldtypes/pages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/pages.png -------------------------------------------------------------------------------- /assets/fieldtypes/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/radio.png -------------------------------------------------------------------------------- /assets/fieldtypes/relate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/relate.png -------------------------------------------------------------------------------- /assets/fieldtypes/select.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/select.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/table.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/table.gif -------------------------------------------------------------------------------- /assets/fieldtypes/tags.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/tags.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/text.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/text.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/time.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/time.gif -------------------------------------------------------------------------------- /assets/fieldtypes/toggle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/toggle.gif -------------------------------------------------------------------------------- /assets/fieldtypes/users.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/users.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/video.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/video.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/yaml.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/yaml.jpg -------------------------------------------------------------------------------- /assets/img/other/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/other/bacon.jpg -------------------------------------------------------------------------------- /content/taxonomies/kb_categories/how-to.yaml: -------------------------------------------------------------------------------- 1 | title: Tips, Tricks, and How-Tos 2 | nav_title: How-tos 3 | -------------------------------------------------------------------------------- /assets/examples/navigation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/examples/navigation.png -------------------------------------------------------------------------------- /assets/fieldtypes/fieldset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/fieldset.png -------------------------------------------------------------------------------- /assets/fieldtypes/markdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/markdown.png -------------------------------------------------------------------------------- /assets/fieldtypes/redactor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/redactor.png -------------------------------------------------------------------------------- /assets/fieldtypes/revealer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/revealer.gif -------------------------------------------------------------------------------- /assets/fieldtypes/section.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/section.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/suggest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/suggest.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/taxonomy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/taxonomy.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/template.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/template.jpg -------------------------------------------------------------------------------- /assets/fieldtypes/textarea.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/textarea.jpg -------------------------------------------------------------------------------- /assets/img/other/cp-assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/other/cp-assets.png -------------------------------------------------------------------------------- /assets/img/screenshots/cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cli.png -------------------------------------------------------------------------------- /content/collections/docs/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Documentation 2 | parse_content: false 3 | section: section-docs 4 | -------------------------------------------------------------------------------- /content/collections/modifiers/folder.yaml: -------------------------------------------------------------------------------- 1 | order: alphabetical 2 | parse_content: false 3 | template: modifier 4 | -------------------------------------------------------------------------------- /content/collections/variables/folder.yaml: -------------------------------------------------------------------------------- 1 | order: alphabetical 2 | parse_content: false 3 | template: variable 4 | -------------------------------------------------------------------------------- /assets/examples/cascade-post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/examples/cascade-post.jpg -------------------------------------------------------------------------------- /assets/examples/session-dump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/examples/session-dump.png -------------------------------------------------------------------------------- /assets/fieldtypes/checkboxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/checkboxes.png -------------------------------------------------------------------------------- /assets/fieldtypes/collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/collection.png -------------------------------------------------------------------------------- /assets/fieldtypes/collections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/collections.png -------------------------------------------------------------------------------- /assets/fieldtypes/replicator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/fieldtypes/replicator.jpg -------------------------------------------------------------------------------- /assets/img/other/breadcrumbs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/other/breadcrumbs.png -------------------------------------------------------------------------------- /assets/img/trail-guides/addon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/addon.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/debug.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/debug.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/forms.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/l10n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/l10n.png -------------------------------------------------------------------------------- /assets/img/trail-guides/urls.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/urls.jpg -------------------------------------------------------------------------------- /assets/img/other/assets-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/other/assets-manager.png -------------------------------------------------------------------------------- /assets/img/screenshots/cp-forms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-forms.jpg -------------------------------------------------------------------------------- /assets/img/screenshots/cp-forms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-forms.png -------------------------------------------------------------------------------- /assets/img/screenshots/cp-login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-login.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/assets.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/assets.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/caching.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/caching.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/search.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/search.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/theming.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/theming.jpg -------------------------------------------------------------------------------- /content/collections/docs/managing-users-in-the-cp.md: -------------------------------------------------------------------------------- 1 | title: Managing Users 2 | id: 0bd0ac66-8720-4cb9-aa59-d7d1f2623b7c 3 | -------------------------------------------------------------------------------- /content/collections/tags/folder.yaml: -------------------------------------------------------------------------------- 1 | order: alphabetical 2 | template: tag 3 | parse_content: false 4 | fieldset: tags 5 | -------------------------------------------------------------------------------- /assets/examples/password-fieldtype.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/examples/password-fieldtype.gif -------------------------------------------------------------------------------- /assets/img/other/assets-filetypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/other/assets-filetypes.png -------------------------------------------------------------------------------- /assets/img/other/cp-asset-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/other/cp-asset-manager.png -------------------------------------------------------------------------------- /assets/img/screenshots/cp-assets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-assets.png -------------------------------------------------------------------------------- /assets/img/screenshots/cp-metrics.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-metrics.jpg -------------------------------------------------------------------------------- /assets/img/screenshots/cp-settings.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-settings.jpg -------------------------------------------------------------------------------- /assets/img/screenshots/debug-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/debug-bar.png -------------------------------------------------------------------------------- /assets/img/screenshots/performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/performance.png -------------------------------------------------------------------------------- /assets/img/screenshots/read-only.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/read-only.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/taxonomies.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/taxonomies.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/upgrading.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/upgrading.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/yaml-101.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/yaml-101.jpg -------------------------------------------------------------------------------- /content/collections/docs/managing-content-in-the-cp.md: -------------------------------------------------------------------------------- 1 | title: Managing Content 2 | id: 55ec7b74-3e44-4282-b2fb-ced8c37c694a 3 | -------------------------------------------------------------------------------- /content/taxonomies/kb_categories/troubleshooting.yaml: -------------------------------------------------------------------------------- 1 | title: Troubleshooting Common Scenarios 2 | nav_title: Troubleshooting 3 | -------------------------------------------------------------------------------- /assets/img/other/cp-asset-fieldtype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/other/cp-asset-fieldtype.png -------------------------------------------------------------------------------- /assets/img/screenshots/cp-collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-collection.png -------------------------------------------------------------------------------- /assets/img/screenshots/cp-page-tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-page-tree.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/nice-assets.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/nice-assets.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/permissions.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/permissions.jpg -------------------------------------------------------------------------------- /assets/examples/pagination-auto-links.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/examples/pagination-auto-links.png -------------------------------------------------------------------------------- /assets/img/trail-guides/content-types.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/content-types.jpg -------------------------------------------------------------------------------- /assets/img/trail-guides/getting-started.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/getting-started.jpg -------------------------------------------------------------------------------- /content/collections/kb/folder.yaml: -------------------------------------------------------------------------------- 1 | title: Knowledge Base 2 | order: alphabetical 3 | template: kb/article 4 | parse_content: false 5 | -------------------------------------------------------------------------------- /content/collections/widgets/folder.yaml: -------------------------------------------------------------------------------- 1 | order: alphabetical 2 | template: docs/widget 3 | parse_content: false 4 | fieldset: widget 5 | -------------------------------------------------------------------------------- /assets/img/trail-guides/template-language.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/trail-guides/template-language.jpg -------------------------------------------------------------------------------- /content/collections/fieldtypes/folder.yaml: -------------------------------------------------------------------------------- 1 | order: alphabetical 2 | template: fieldtype 3 | fieldset: fieldtypes 4 | parse_content: false 5 | -------------------------------------------------------------------------------- /assets/img/screenshots/cp-update-available.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statamic/v2-docs/HEAD/assets/img/screenshots/cp-update-available.png -------------------------------------------------------------------------------- /content/pages/7.addons/9.api/deprecations/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Deprecations 3 | template: deprecations 4 | id: dab8a4fd-7e1d-4ea4-8e95-c925faec797a 5 | --- 6 | -------------------------------------------------------------------------------- /content/collections/modifiers/piped.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: 124c1470-a9da-11e7-8f1a-0800200c9a66 6 | --- 7 | Alias of [option_list](/modifiers/option_list) 8 | -------------------------------------------------------------------------------- /content/collections/kb/oauth.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: How can I authenticate users with OAuth? 3 | kb_categories: 4 | - Tips, Tricks, and How-Tos 5 | id: 1fd12dea-5207-44ce-b654-d57aff7cd9a4 6 | redirect: /oauth 7 | --- 8 | -------------------------------------------------------------------------------- /content/collections/tags/iterate.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Iterate 3 | overview: Iterate over an array with key/value pairs. 4 | id: aab1283e-72eb-42ac-b215-cc0a6e67a569 5 | --- 6 | See the [Foreach tag](/tags/foreach). 7 | -------------------------------------------------------------------------------- /content/collections/tags/nav-count.md: -------------------------------------------------------------------------------- 1 | --- 2 | overview: Return the number of pages in a Nav tree. 3 | title: Count 4 | id: 684e2406-1d15-4f80-b72a-defc46c8d7c8 5 | --- 6 | It uses the same parameters as the `nav` tag. 7 | -------------------------------------------------------------------------------- /content/globals/global.yaml: -------------------------------------------------------------------------------- 1 | id: d9bfc09a-3a90-41d3-8acc-3f551f8432af 2 | site_name: Redwood 3 | author_name: Niles Peppertrout 4 | test_date: October 1 2017 5 | test_future_date: October 1 2019 6 | footer_class: minimum 7 | -------------------------------------------------------------------------------- /content/collections/variables/csrf_token.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - global 4 | id: 1ff95c0b-e62a-46c2-87e7-75d84b10eaf1 5 | --- 6 | Output the CSRF token from the session. 7 | 8 | ``` 9 | {{ csrf_token }} 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/variables/is_page.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - page 4 | id: 33ef6439-a311-436d-8305-1df4c6727476 5 | --- 6 | A boolean for whether the current content is a page. Naturally, this will be `true` for pages. 7 | -------------------------------------------------------------------------------- /content/collections/variables/is_term.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - term 4 | id: 25dd3a4d-306c-48b3-a204-59eee23231b0 5 | --- 6 | A boolean for whether the current content is a term. Naturally, this will be `true` for terms. 7 | -------------------------------------------------------------------------------- /content/collections/variables/is_asset.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 24115b71-ac28-460d-a48a-36ed14950ef8 5 | --- 6 | A boolean for whether the current content is an asset. Naturally, this will be `true` for assets. 7 | -------------------------------------------------------------------------------- /content/collections/variables/is_entry.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: 001d8875-64aa-4c23-82d5-f84da62b927e 5 | --- 6 | A boolean for whether the current content is an entry. Naturally, this will be `true` for entries. 7 | -------------------------------------------------------------------------------- /content/collections/variables/response_code.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 3c2eaa93-00ce-4e48-868b-2f89f02c8504 3 | types: 4 | - global 5 | --- 6 | The response code of the request. This will be `200` for URLs that exist and `404` for those that don't. 7 | -------------------------------------------------------------------------------- /content/collections/events/deprecated-system-updated.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: system.updated 3 | class: system.updated 4 | deprecated: true 5 | id: a001caf6-9c65-4021-a403-0b2f34cd8f63 6 | --- 7 | See [StatamicUpdated](/addons/events/statamic-updated) 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Statamic 2 Documentation 2 | 3 | This repo holds the content for the Statamic v2 docs site. 4 | [https://v2.statamic.com](https://v2.statamic.com) 5 | 6 | Any commits made to this repo's `master` branch will be reflected on the site. 7 | -------------------------------------------------------------------------------- /content/collections/tags/asset.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Asset 3 | overview: "Used to retrieve a single asset's data." 4 | id: ef55412a-8a91-4714-b745-0245eddb62d9 5 | canonical_url: https://statamic.dev/asset 6 | --- 7 | See the [Assets tag](/tags/assets). 8 | -------------------------------------------------------------------------------- /content/collections/tags/trans_choice.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Translate Choice 3 | overview: Translates a string, using pluralization 4 | id: 4c808c0e-31d6-4679-b7e2-c8187904e659 5 | --- 6 | See the [trans tag's pluralization section](/tags/trans#pluralization). 7 | -------------------------------------------------------------------------------- /content/collections/variables/get_post.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: eadae010-e651-4504-bea4-a9baeea1c0b5 3 | types: 4 | - global 5 | --- 6 | This variable combines both `{{ get }}` and `{{ post }}`, with `POST` data taking precedence in the event of identical variables. 7 | -------------------------------------------------------------------------------- /content/collections/variables/extension.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: c35b0240-645f-44c6-9a9c-0cb1136e7b26 5 | --- 6 | The file extension of the asset. 7 | 8 | ``` 9 | {{ extension }} 10 | ``` 11 | 12 | ``` .language-output 13 | jpg 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/width.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 16d27ea8-f331-4574-8454-6aa34b5f4eaa 5 | --- 6 | The width of an image asset, in pixels. 7 | 8 | ``` 9 | {{ width }} 10 | ``` 11 | 12 | ``` .language-output 13 | 900 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/height.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 299b5fad-d2ac-4bef-9107-100908e2c9d7 5 | --- 6 | The height of an image asset, in pixels. 7 | 8 | ``` 9 | {{ height }} 10 | ``` 11 | 12 | ``` .language-output 13 | 643 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/current_uri.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 461b4e7a-2918-40e4-80fc-54b178db4074 3 | types: 4 | - global 5 | --- 6 | The current URI (URL without domain). 7 | 8 | ``` 9 | {{ current_uri }} 10 | ``` 11 | 12 | ``` .language-output 13 | /variables 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/current_url.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 8f32d8f6-b9b6-4126-a517-661e6089ff41 3 | types: 4 | - global 5 | --- 6 | The current URL. 7 | 8 | ``` 9 | {{ current_url }} 10 | ``` 11 | 12 | ``` .language-output 13 | https://docs.statamic.com/variables 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/taxonomy.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - term 4 | id: 43796530-e4af-448f-be6e-2bae1670b2e4 5 | --- 6 | Get the name of the taxonomy the term belongs to. 7 | 8 | ``` 9 | {{ taxonomy }} 10 | ``` 11 | 12 | ``` .language-output 13 | categories 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/template.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - global 4 | id: ddfaa9a1-eded-4f27-a296-0d8fd3dc6d1b 5 | --- 6 | The name of the template currently in use. 7 | 8 | ``` 9 | {{ template }} 10 | ``` 11 | 12 | ``` .language-output 13 | landing-two 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/collection.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: 0f6de8a2-b340-4733-a67f-c5f2296d70c6 5 | --- 6 | Get the name of the collection the entry belongs to. 7 | 8 | ``` 9 | {{ collection }} 10 | ``` 11 | 12 | ``` .language-output 13 | blog 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/kb/settings.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Managing settings and environments 3 | overview: > 4 | A run-down of the different types of settings in Statamic. 5 | id: 163ca938-1950-4d9b-b06a-8a7f3f6f4aef 6 | kb_categories: 7 | - Tips, Tricks, and How-Tos 8 | redirect: /settings 9 | --- -------------------------------------------------------------------------------- /content/collections/tags/pages-listing.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Listing 3 | overview: An alias of the `pages` tag, for backwards compatibility. 4 | id: 4b87448a-0bbd-46be-87ee-a194ea0ea14d 5 | --- 6 | ``` 7 | {{ pages:listing from="/about" }} 8 | ... 9 | {{ /pages:listing }} 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/variables/datestring.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: 1a16bf0e-ee75-47b4-ac6e-32c95279c766 5 | --- 6 | Get the pre-formatted date of the entry as a string. 7 | 8 | ``` 9 | {{ date }} 10 | ``` 11 | 12 | ``` .language-output 13 | February 16, 2016 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/filename.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 0af805cd-0a3e-4b07-afc3-edd1a8a688e0 5 | --- 6 | The filename of the asset, without the extension. 7 | 8 | ``` 9 | {{ filename }} 10 | ``` 11 | 12 | ``` .language-output 13 | black-bear-cubs 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/path.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: dcb4c134-08ad-4b48-a2dd-1f8fcd652c57 5 | --- 6 | The path to the file, relative to the asset container. 7 | 8 | ``` 9 | {{ path }} 10 | ``` 11 | 12 | ``` .language-output 13 | img/black-bear-cubs.jpg 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/site_url.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: e6fdbeb6-7808-45b0-b012-89a34993778b 3 | types: 4 | - global 5 | --- 6 | The URL of the site. Aliased by `homepage`. 7 | 8 | ``` 9 | {{ site_url }} 10 | ``` 11 | 12 | ``` .language-output 13 | https://docs.statamic.com/ 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/homepage.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - global 4 | id: 80599fcb-69df-4de8-ad79-c918d9919e24 5 | --- 6 | The URL of the homepage. An alias of `site_url`. 7 | 8 | ``` 9 | {{ site_url }} 10 | ``` 11 | 12 | ``` .language-output 13 | https://docs.statamic.com/ 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/size_bytes.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: d92f6a3d-2e78-4f30-a7ee-3a69bd652eaf 5 | --- 6 | The file size of the asset, in bytes. Also available as `size_b`. 7 | 8 | ``` 9 | {{ size_bytes }} 10 | ``` 11 | 12 | ``` .language-output 13 | 130754 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/tags/entries-listing.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Listing 3 | id: 64565e97-5461-4b2d-a3e9-e42dbf60c7e4 4 | overview: An alias of the `entries` tag, for backwards compatibility. 5 | --- 6 | ``` 7 | {{ entries:listing from="/company/news" }} 8 | ... 9 | {{ /entries:listing }} 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/variables/size_gigabytes.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 5e1a2049-840d-41b0-9f22-90d368bc7a8d 5 | --- 6 | The file size of the asset, in gigabytes. Also available as `size_gb`. 7 | 8 | ``` 9 | {{ sizegiga_bytes }} 10 | ``` 11 | 12 | ``` .language-output 13 | 0.00 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/size_kilobytes.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 15c87908-19aa-4cfe-9da9-cb2f74841fd8 5 | --- 6 | The file size of the asset, in kilobytes. Also available as `size_kb`. 7 | 8 | ``` 9 | {{ size_kilobytes }} 10 | ``` 11 | 12 | ``` .language-output 13 | 127.69 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/size_megabytes.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 4acb45ef-dea2-483b-97c3-31faeb27b232 5 | --- 6 | The file size of the asset, in megabytes. Also available as `size_mb`. 7 | 8 | ``` 9 | {{ size_megabytes }} 10 | ``` 11 | 12 | ``` .language-output 13 | 0.12 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/url.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - content 4 | id: d511b772-bdbe-4d20-9ed9-3c87d72fb946 5 | --- 6 | Get the URL to the content. This is relative and will _not_ include your site URL. 7 | 8 | ``` 9 | {{ url }} 10 | ``` 11 | 12 | ``` .language-output 13 | /posts/bacon 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/kb/emails.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to configure and send email 3 | id: cb453729-0d2f-4924-ba88-b7b1f95747af 4 | overview: > 5 | Emails are used throughout Statamic, from within the Control Panel to inside tags and addons. 6 | kb_categories: 7 | - Tips, Tricks, and How-Tos 8 | redirect: /email 9 | --- -------------------------------------------------------------------------------- /content/collections/variables/basename.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 4aeaaa17-b92f-4be0-9f46-9e31c2589b8c 5 | --- 6 | The basename of the asset, which is the filename _with_ the extension. 7 | 8 | ``` 9 | {{ basename }} 10 | ``` 11 | 12 | ``` .language-output 13 | black-bear-cubs.jpg 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/order_type.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: 4e41a594-cb06-4963-a60e-3031ce568f97 5 | --- 6 | Get the order type of an entry. This could be `date`, `alphabetical`, or `number`. 7 | 8 | ``` 9 | {{ order_type }} 10 | ``` 11 | 12 | ``` .language-output 13 | {{ number }} 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/tags/taxonomy-listing.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Listing 3 | id: 43c0bdbc-a73a-4713-a6cd-3ab829a0b254 4 | overview: An alias of the `taxonomy` tag. 5 | --- 6 | ``` 7 | {{ taxonomy:listing from="categories" }} 8 | ... 9 | {{ /taxonomy:listing }} 10 | ``` 11 | 12 | See the [Taxonomy Tag](/tags/taxonomy). 13 | -------------------------------------------------------------------------------- /content/collections/variables/count.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - term 4 | id: b4cd82ee-8a96-4aba-a8fc-dfee171335de 5 | --- 6 | Get the number of entries that use this taxonomy term. 7 | 8 | ``` 9 | There are {{ count }} 'news' entries. 10 | ``` 11 | 12 | ``` .language-output 13 | There are 85 'news' entries. 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/permalink.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - content 4 | id: 548cde5a-c65e-42b0-9334-efe18e9e260b 5 | --- 6 | Get the absolute URL to the content. This will include your site URL. 7 | 8 | ``` 9 | {{ permalink }} 10 | ``` 11 | 12 | ``` .language-output 13 | http://example.com/posts/bacon 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/timestamp.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: aaf843db-96eb-4cfb-ba9c-45a86fcd2d34 5 | --- 6 | Get the timestamp of the entry. This will be an integer. 7 | 8 | Alias of `datestamp`. 9 | 10 | ``` 11 | {{ timestamp }} 12 | ``` 13 | 14 | ``` .language-output 15 | 1425772800 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/variables/is_image.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 89e75dec-7f33-4217-b040-dc2a18de5d83 5 | --- 6 | A boolean for whether the asset is an image. 7 | 8 | ``` 9 | {{ if is_image }} 10 | 11 | {{ else }} 12 | Download 13 | {{ /if }} 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/events/page-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PageSaved 3 | class: Statamic\Events\Data\PageSaved 4 | id: 46cd80fa-06dd-473e-b095-cfca0d6486e5 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a page is saved. 7 | 8 | ``` 9 | public function handle(PageSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/user-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: UserSaved 3 | class: Statamic\Events\Data\UserSaved 4 | id: 7aceeb55-e956-4bda-a731-4339862ea482 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a user is saved. 7 | 8 | ``` 9 | public function handle(UserSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/singular.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: ef2a1b64-d2a6-4ade-988d-33b279e47bfd 5 | --- 6 | Get the singular form of an English word. 7 | 8 | ```.language-yaml 9 | word: nickles 10 | ``` 11 | 12 | ``` 13 | {{ word | singular }} 14 | ``` 15 | 16 | ```.language-output 17 | nickle 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/surround.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 1fea97b2-c42f-495b-846a-6c688d3b5eca 5 | --- 6 | Surrounds a string with another string. 7 | 8 | ```.language-yaml 9 | string: ͜ 10 | ``` 11 | 12 | ``` 13 | {{ string | surround:ʘ }} 14 | ``` 15 | 16 | ```.language-output 17 | ʘ ͜ ʘ 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/variables/published.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - content 4 | id: d374ba18-d8cc-4700-a79c-c7da5a26b314 5 | --- 6 | A boolean that specifies whether the content is published. Or "live", or "not a draft". 7 | 8 | ``` 9 | {{ if published }} 10 | Published! 11 | {{ else }} 12 | Draft 13 | {{ /if }} 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/events/role-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RoleSaved 3 | class: Statamic\Events\Data\RoleSaved 4 | id: 1a508aa2-530c-49fa-ba0a-d0d124fd40ca 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a user role is saved. 7 | 8 | ``` 9 | public function handle(RoleSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/term-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TermSaved 3 | class: Statamic\Events\Data\TermSaved 4 | id: 4be1341c-b71a-4340-9b75-3b7bc2a25003 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a taxonomy term is saved. 7 | 8 | ``` 9 | public function handle(TermSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/time.md: -------------------------------------------------------------------------------- 1 | title: Time 2 | description: A timepicker. It lets you pick a time. 3 | overview: The Time fieldtype is a simple timepicker that operates in 24-hour mode and supports keyboard `up` and `down` controls for ease of use. 4 | image: /assets/fieldtypes/time.gif 5 | id: ccfbaf71-7823-4f71-a375-e874035f80ca 6 | -------------------------------------------------------------------------------- /content/pages/knowledge-base/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: The Knowledge Base 3 | id: 85315b66-1a13-49d3-8c64-4571658a5759 4 | template: kb/index 5 | section: section-knowledge-base-index 6 | overview: Articles, tips, tricks, and other helpful content to help answer the hard-to-categorize questions you might have. Godspeed on your quest! 7 | --- 8 | -------------------------------------------------------------------------------- /content/collections/events/entry-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: EntrySaved 3 | class: Statamic\Events\Data\EntrySaved 4 | id: 7d37e062-c935-4857-8739-a940dc84cb40 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when an entry has been saved. 7 | 8 | ``` 9 | public function handle(EntrySaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/page-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PageDeleted 3 | class: Statamic\Events\Data\PageDeleted 4 | id: d6ba2a80-0f18-474f-8bf1-41d7c4f43fa3 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a page is deleted. 7 | 8 | ``` 9 | public function handle(PageDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/user-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: UserDeleted 3 | class: Statamic\Events\Data\UserDeleted 4 | id: cc7268ee-9ae6-4166-89c1-5b3e6e5867da 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a user is deleted. 7 | 8 | ``` 9 | public function handle(UserDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/ceil.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | - utility 5 | id: 29863a25-6283-4338-baf5-82bd7c57541c 6 | --- 7 | Rounds a number up to the next whole number. 8 | 9 | ```.language-yaml 10 | number: 25.98 11 | ``` 12 | 13 | ``` 14 | {{ number | ceil }} 15 | ``` 16 | 17 | ```.language-output 18 | 26 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/modifiers/floor.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | - utility 5 | id: 0dc57cca-67b2-45a1-a02d-915ac64f064f 6 | --- 7 | Rounds a number down to the next whole number. 8 | 9 | ```.language-yaml 10 | number: 25.98 11 | ``` 12 | 13 | ``` 14 | {{ number | floor }} 15 | ``` 16 | 17 | ```.language-output 18 | 25 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/variables/focus_css.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: cd50cb3d-28cb-4738-88a2-dac4e4244911 5 | --- 6 | The focal point of the asset, in a format suitable for the background-position CSS property, if one has been set. 7 | 8 | ``` 9 | {{ focus_css }} 10 | ``` 11 | 12 | ``` .language-output 13 | 50% 30% 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/events/globals-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: GlobalsSaved 3 | class: Statamic\Events\Data\GlobalsSaved 4 | id: 776991a6-0ca0-4cc0-bf93-fee80e948552 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a global set is saved. 7 | 8 | ``` 9 | public function handle(GlobalsSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/role-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RoleDeleted 3 | class: Statamic\Events\Data\RoleDeleted 4 | id: 17a2773f-7edc-4804-97a8-71e904ce4cd5 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a user role is deleted. 7 | 8 | ``` 9 | public function handle(RoleDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/term-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TermDeleted 3 | class: Statamic\Events\Data\TermDeleted 4 | id: a3255377-abb6-461c-b0ce-0f29263711fe 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a taxonomy term is deleted. 7 | 8 | ``` 9 | public function handle(TermDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/kb/licensing.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: How does Statamic's license work? 3 | alias: 4 | - Why is my site showing a giant statamic logo? 5 | - Why isn't my production site loading? 6 | id: cbe048ab-93c3-44aa-9aa8-ee13a04d78eb 7 | kb_categories: 8 | - Tips, Tricks, and How-Tos 9 | --- 10 | Article moved to [Licensing](/licensing). -------------------------------------------------------------------------------- /content/pages/1.tags/index.md: -------------------------------------------------------------------------------- 1 | title: Tags 2 | mount: tags 3 | id: 6e7db349-9253-40d6-95cf-a59cf0bd8944 4 | template: tags 5 | overview: > 6 | Tags are dynamic template elements that give you the ability to fetch, filter, and display content from anywhere in your site, enhance and simplify your markup, and empower your users with dynamic features. 7 | -------------------------------------------------------------------------------- /content/collections/events/asset-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetDeleted 3 | class: Statamic\Events\Data\AssetDeleted 4 | id: ec46b260-7840-495c-b5c3-42075c098b43 5 | --- 6 | This is a [data event](/addons/events#data-events) that is dispatched when an asset has been deleted. 7 | 8 | ``` 9 | public function handle(AssetDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/asset-moved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetMoved 3 | class: Statamic\Events\Data\AssetMoved 4 | id: 6b35535a-ec21-43f1-8f1e-1ca8a129addf 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when an asset has been renamed or moved. 7 | 8 | ``` 9 | public function handle(AssetMoved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/entry-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: EntryDeleted 3 | class: Statamic\Events\Data\EntryDeleted 4 | id: c3d4f5c2-8ef6-4e16-a96a-75280fd62c1f 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when an entry has been deleted. 7 | 8 | ``` 9 | public function handle(EntryDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/taxonomy-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TaxonomySaved 3 | class: Statamic\Events\Data\TaxonomySaved 4 | id: 5422c533-2c5d-4710-aa3c-ec51958ce09d 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a taxonomy is saved. 7 | 8 | ``` 9 | public function handle(TaxonomySaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/kb/logging.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: How to configure and use logging 3 | alias: 4 | - How do I log errors to Slack? 5 | - What are my logging options? 6 | id: b518fa3d-b41f-4238-b1de-02ada96e2713 7 | kb_categories: 8 | - Tips, Tricks, and How-Tos 9 | --- 10 | 11 | Find out all about logging over on the [Debugging](/debugging) page. -------------------------------------------------------------------------------- /content/collections/events/asset-uploaded.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetUploaded 3 | class: Statamic\Events\Data\AssetUploaded 4 | id: c33720bc-caec-4820-813f-4182eb2e4ea0 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when an asset has been uploaded. 7 | 8 | ``` 9 | public function handle(AssetUploaded $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/fieldset-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: FieldsetSaved 3 | class: Statamic\Events\Data\FieldsetSaved 4 | id: c1def770-4344-4715-a8df-929bf93e7869 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a fieldset has been saved. 7 | 8 | ``` 9 | public function handle(FieldsetSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/globals-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: GlobalsDeleted 3 | class: Statamic\Events\Data\GlobalsDeleted 4 | id: 6c5f2623-20dd-4540-b078-7b6e4f03b548 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a global set is deleted. 7 | 8 | ``` 9 | public function handle(GlobalsDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/user-group-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: UserGroupSaved 3 | class: Statamic\Events\Data\UserGroupSaved 4 | id: 5e2bb1c6-5738-4d6f-98a9-ffecb8c0f318 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a user group is saved. 7 | 8 | ``` 9 | public function handle(UserGroupSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_weekday.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: a190fa95-c405-4e2c-b3c0-adfbe21f9bb2 6 | --- 7 | Returns `true` if date is a weekday. 8 | 9 | ```.language-yaml 10 | date: December 25 2015 11 | ``` 12 | 13 | ``` 14 | {{ if date | is_weekday }} 15 | ``` 16 | 17 | 18 | ```.language-output 19 | true 20 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/swap_case.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 5c1714c1-83fe-4690-8607-60d1f269408b 6 | --- 7 | Returns a case swapped version of the string. 8 | 9 | ```.language-yaml 10 | string: IpHONE 11 | ``` 12 | 13 | ``` 14 | {{ string | swap_case }} 15 | ``` 16 | 17 | ```.language-output 18 | iPhone 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/events/asset-replaced.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetReplaced 3 | class: Statamic\Events\Data\AssetReplaced 4 | id: c424862f-fca4-4e7a-bd26-cae01daae03f 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when an asset's file has been replaced. 7 | 8 | ``` 9 | public function handle(AssetReplaced $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/taxonomy-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TaxonomyDeleted 3 | class: Statamic\Events\Data\TaxonomyDeleted 4 | id: 5ab4a02e-0b56-4f76-b194-4d14257b3937 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a taxonomy is deleted. 7 | 8 | ``` 9 | public function handle(TaxonomyDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/lcfirst.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 638e875e-2cc8-4b7b-953a-4f1a44c76e4d 6 | --- 7 | Converts the first character of the supplied string to lower case. 8 | 9 | ```.language-yaml 10 | title: Wow 11 | ``` 12 | 13 | ``` 14 | {{ title | lcfirst }} 15 | ``` 16 | 17 | ```.language-output 18 | wow 19 | ``` -------------------------------------------------------------------------------- /content/collections/events/collection-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: CollectionSaved 3 | class: Statamic\Events\Data\CollectionSaved 4 | id: fa9a6e6d-fbe8-4dd8-8762-3c80f56db15d 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a collection has been saved. 7 | 8 | ``` 9 | public function handle(CollectionSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/fieldset-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: FieldsetDeleted 3 | class: Statamic\Events\Data\FieldsetDeleted 4 | id: 8afc651d-2e4d-4ed1-b2b0-cb33eb4fd326 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a fieldset has been deleted. 7 | 8 | ``` 9 | public function handle(FieldsetDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/submission-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: SubmissionSaved 3 | class: Statamic\Events\Data\SubmissionSaved 4 | id: a0701839-869a-4b62-828c-eeb5cd5130f1 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a form submission is saved. 7 | 8 | ``` 9 | public function handle(SubmissionSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/user-group-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: UserGroupDeleted 3 | class: Statamic\Events\Data\UserGroupDeleted 4 | id: f0392db2-e84a-4318-bc23-f9bc934ee268 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a user group is deleted. 7 | 8 | ``` 9 | public function handle(UserGroupDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/count.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | id: a7b58312-3498-4807-b2bc-6fcb640fe231 5 | --- 6 | Count the number of items in an array. 7 | 8 | ```.language-yaml 9 | fruit: 10 | - apples 11 | - bananas 12 | - bacon 13 | ``` 14 | 15 | ``` 16 | {{ fruit | count }} 17 | ``` 18 | 19 | ```.language-output 20 | 3 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_weekend.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: 22a4460a-b24a-4e24-bd8c-655d03e6d3de 6 | --- 7 | Returns `true` if date is on the weekend. 8 | 9 | ```.language-yaml 10 | date: December 25 2015 11 | ``` 12 | 13 | ``` 14 | {{ if date | is_weekend }} 15 | ``` 16 | 17 | 18 | ```.language-output 19 | false 20 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/ucfirst.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: d977361d-0576-469d-9430-f4d82b5666b4 5 | --- 6 | Converts the first character of a string to upper case. 7 | 8 | ```.language-yaml 9 | string: i wanna go home. 10 | ``` 11 | 12 | ``` 13 | {{ string | ucfirst }} 14 | ``` 15 | 16 | ```.language-output 17 | I wanna go home. 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/upper.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 33b1003c-6ce8-47db-a4ec-bbc323e15820 5 | --- 6 | Transform a string into uppercase. Multi-byte friendly. 7 | 8 | ```.language-yaml 9 | string: That is über neat. 10 | ``` 11 | 12 | ``` 13 | {{ string | upper }} 14 | ``` 15 | 16 | ```.language-output 17 | THAT IS ÜBER NEAT. 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/events/asset-folder-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetFolderSaved 3 | class: Statamic\Events\Data\AssetFolderSaved 4 | id: 79049b29-65c4-4a0b-a69a-b003668952c9 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when an asset folder has been saved. 7 | 8 | ``` 9 | public function handle(AssetFolderSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_json.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - conditions 4 | - utility 5 | id: a314e7fc-ad72-4afb-88b8-1ca4a0100c17 6 | --- 7 | Returns `true` if string is valid json 8 | 9 | ```.language-yaml 10 | data: '{"book": "All The Places You'll Go"}' 11 | ``` 12 | 13 | ``` 14 | {{ if data | is_json }} 15 | ``` 16 | 17 | ```.language-output 18 | true 19 | ``` -------------------------------------------------------------------------------- /content/collections/tags/theme-partial.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Partial 3 | overview: Render a partial template. 4 | id: 2b8fb14d-353d-465e-b206-b27436c6692a 5 | --- 6 | The same as the [`partial` tag](/tags/partial), but instead of specifying the partial as a tag part, you must pass it in the `src` parameter. 7 | 8 | ``` 9 | {{ theme:partial src="my-partial" }} 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/collection-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: CollectionDeleted 3 | class: Statamic\Events\Data\CollectionDeleted 4 | id: b3e49a21-90d8-4e64-a27d-44bb14032e91 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a collection has been deleted. 7 | 8 | ``` 9 | public function handle(CollectionDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/submission-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: SubmissionDeleted 3 | class: Statamic\Events\Data\SubmissionDeleted 4 | id: 3946a718-6b14-4d26-b834-53585e3e180c 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a form submission is deleted. 7 | 8 | ``` 9 | public function handle(SubmissionDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/segment.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 87cb26b4-3eb1-4bd7-8d80-913f1ba21932 6 | --- 7 | Returns a segment by number from any valid URL or URI. 8 | 9 | ```.language-yaml 10 | example: /this/is/pretty/neat 11 | ``` 12 | 13 | ``` 14 | {{ example | segment:4 }} 15 | ``` 16 | 17 | ```.language-output 18 | neat 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/variables/segment_x.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: edd048d2-5e9a-4f80-ad79-c0c22d711723 3 | types: 4 | - global 5 | --- 6 | Given "x", any segment number, will return the value of that particular URL segment if it's present. 7 | 8 | Example URL: `/put/that/cookie/down` 9 | 10 | ``` 11 | {{ segment_3 }} 12 | ``` 13 | 14 | ``` .language-output 15 | cookie 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/variables/size.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: 514642f6-5e7b-4ffc-abad-7a2637615a45 5 | --- 6 | The file size of the asset, in an appropriate human-readable format. 7 | 8 | ``` 9 | {{ assets:files }} 10 | {{ size }} 11 | {{ /assets:files }} 12 | ``` 13 | 14 | ``` .language-output 15 | 11 B 16 | 127.69 KB 17 | 1.5 MB 18 | 2 GB 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/events/asset-folder-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetFolderDeleted 3 | class: Statamic\Events\Data\AssetFolderDeleted 4 | id: 8bc7b101-fb5c-4419-a33d-4314bdf4f19a 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when an asset folder has been deleted. 7 | 8 | ``` 9 | public function handle(AssetFolderDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/settings-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: SettingsSaved 3 | class: Statamic\Events\Data\SettingsSaved 4 | id: 5921ce09-be89-4334-b297-81f86ccd92de 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a settings page is saved (eg. System, Caching, etc) 7 | 8 | ``` 9 | public function handle(SettingsSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/template.md: -------------------------------------------------------------------------------- 1 | title: Template 2 | description: Pick from your available theme templates. 3 | overview: > 4 | Pick and set your page or entry’s template. Be sure to name the field `template` if you want it to be able to change the template. It's a special variable name. 5 | id: 76e0ee52-a3c4-4904-8b5c-f722bbb20482 6 | image: /assets/fieldtypes/template.jpg 7 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/hidden.md: -------------------------------------------------------------------------------- 1 | title: Hidden 2 | description: Set default data easily with hidden fields. 3 | overview: "If you want to ensure some default data is created along with new pages or entries, this is a great way to do it. Set whatever you need as the `default` value and you're done." 4 | id: 791c3fb3-0d3c-4e17-bd97-3ab9529a8691 5 | image: /assets/fieldtypes/hidden.gif 6 | -------------------------------------------------------------------------------- /content/collections/tags/link.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Link 3 | overview: Makes links. Alias of the `path` tag. 4 | id: dbac10ed-98e3-4a6f-bdef-c5d14a04994e 5 | --- 6 | Exactly the same as the [Path tag](/tags/path) but arguably a more natural sounding tag to use in your templates. 7 | 8 | ``` 9 | {{ link to="contact" }} 10 | ``` 11 | 12 | ``` .language-output 13 | /contact 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/variables/slug.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - content 4 | id: b391facf-5041-498b-a244-0df2359ec30e 5 | --- 6 | A slug is the string that identifies your content. It usually sits at the end of the URL. 7 | 8 | ``` 9 |

{{ title }}

10 | {{ slug }} 11 | ``` 12 | 13 | ``` .language-output 14 |

My Thoughts on Bacon

15 | my-thoughts-on-bacon 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/events/file-uploaded.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: FileUploaded 3 | class: Statamic\Events\Data\FileUploaded 4 | id: e67d9617-9518-41b3-8b19-7dd1d4d3b363 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a file is uploaded through a [form:create tag](/tags/form-create). 7 | 8 | ``` 9 | public function handle(FileUploaded $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/backspace.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 9526d59a-3abe-444f-b9a4-b0a8ed2fa880 5 | --- 6 | Removes a specified number of characters from the end of a string. 7 | 8 | ```.language-yaml 9 | title: supercalifragilisticexpialidocious 10 | ``` 11 | 12 | ``` 13 | {{ title | backspace:29 }} 14 | ``` 15 | 16 | ```.language-output 17 | super 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_numberwang.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: f3e9d043-ff25-4778-9915-0cfafc52e166 6 | --- 7 | Is it or is it not numberwang? Returns `true` if it is indeed numberwang. 8 | 9 | ```.language-yaml 10 | number: 1002 11 | ``` 12 | 13 | ``` 14 | {{ if number | is_numberwang }} 15 | ``` 16 | 17 | ```.language-output 18 | ??? 19 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/to_spaces.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | id: d5ee1b1e-0ffa-45cd-b3aa-bfecb9a93325 5 | --- 6 | Converts all tabs in a string to a given number of spaces, `4` by default. This is a boring modifier to output examples of. Here's just a few examples on how the syntax looks. 7 | 8 | ``` 9 | {{ string | to_spaces }} 10 | {{ string | to_spaces:2 }} 11 | ``` 12 | -------------------------------------------------------------------------------- /content/collections/modifiers/url.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: eb68e4e1-c1b2-4806-a477-6c0491616b88 3 | --- 4 | Get the URL of an Asset, Page, Entry, or Taxonomy term from an ID. 5 | 6 | ```.language-yaml 7 | hero_image: 98hf98-sfq4h8f94-fd9s0fj0l 8 | ``` 9 | 10 | ``` 11 | {{ hero_image | url }} 12 | ``` 13 | 14 | ```.language-output 15 | /assets/flying-bacon-wearing-a-batman-mask.jpg 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/variables/last_segment.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: d9ae0cd6-a94e-44d7-b748-5506fa2e5ae7 3 | types: 4 | - global 5 | --- 6 | Since you don't always know how many segments your URL will have, you can always grab the last segment. 7 | 8 | Example URL: `/nestled/safely/under/our/tree` 9 | 10 | ``` 11 | {{ last_segment }} 12 | ``` 13 | 14 | ``` .language-output 15 | tree 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/events/asset-container-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetContainerDeleted 3 | class: Statamic\Events\Data\AssetContainerDeleted 4 | id: 14a7dd32-d393-498e-afd1-ea3b0f66e99c 5 | --- 6 | This is a [data event](/addons/events#data-events) that is dispatched when an asset container has been deleted. 7 | 8 | ``` 9 | public function handle(AssetContainerDeleted $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/repeat.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | id: 828a52f2-469e-4a20-82c1-15fd4d0e568c 5 | --- 6 | Repeats a value any given number of times. For fun. 7 | 8 | ```.language-yaml 9 | lyric: can't touch this 10 | ``` 11 | 12 | ``` 13 | {{ lyric | repeat: 3 }} 14 | ``` 15 | 16 | ```.language-output 17 | can't touch this can't touch this can't touch this 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/word_count.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: a9b3b597-9075-4320-bb6d-721f78c2de78 6 | --- 7 | Returns the number of words in a given string. 8 | 9 | ```.language-yaml 10 | string: There are probably seven words in this sentence. 11 | ``` 12 | 13 | ``` 14 | {{ string | word_count }} 15 | ``` 16 | 17 | ```.language-output 18 | 8 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/textarea.md: -------------------------------------------------------------------------------- 1 | title: Textarea 2 | overview: A simple, multi-line textarea input. 3 | image: /assets/fieldtypes/textarea.jpg 4 | options: 5 | - 6 | name: rows 7 | type: integer 8 | description: > 9 | The number of rows of text to display. 10 | Controls the initial height of the 11 | field. 12 | id: e356827a-26ab-4691-984f-21d623798b3d 13 | -------------------------------------------------------------------------------- /content/collections/events/addon-settings-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AddonSettingsSaved 3 | class: Statamic\Events\Data\AddonSettingsSaved 4 | id: 027f1d15-04e5-484e-af8d-a657af674c05 5 | --- 6 | This is a [data event](/addons/events#data-events) that is dispatched when an addon's settings have been saved in the control panel. 7 | 8 | ``` 9 | public function handle(AddonSettingsSaved $event); 10 | ``` 11 | -------------------------------------------------------------------------------- /content/collections/events/user-registered.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: user.registered 3 | class: user.registered 4 | id: c59712b5-7299-4ea9-b318-84877960a0ab 5 | --- 6 | Fired after a user has registered with the [Register Form](/tags/user-register_form). The `User` will be passed through. 7 | 8 | ``` 9 | public $events = ['user.registered' => 'handle']; 10 | 11 | public function handle(User $user); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/collections/modifiers/at.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 40fb38b6-a2b0-411d-b90b-543b38ac8aa3 5 | --- 6 | Returns the single character at a given position in a string. It starts at zero with the first character. 7 | 8 | ```.language-yaml 9 | title: supercalifragilisticexpialidocious 10 | ``` 11 | 12 | ``` 13 | {{ title | at:21 }} 14 | ``` 15 | 16 | ```.language-output 17 | x 18 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/last.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | - string 5 | - utility 6 | id: 4444ed5b-b543-424b-b7cf-a1eeff0213f9 7 | --- 8 | Returns the last X characters of a string, where X is any positive integer. 9 | 10 | ```.language-yaml 11 | title: 2015 Denver Nuggets 12 | ``` 13 | 14 | ``` 15 | {{ title | last:7 }} 16 | ``` 17 | 18 | ```.language-output 19 | Nuggets 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/to_tabs.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | id: e13ecc17-1458-42f5-a55c-f7fcbac743ad 5 | --- 6 | Converts all instances of a specified number of spaces in a string to tabs. `4` by default. This is a boring modifier to output examples of. Here's just a few examples on how the syntax looks. 7 | 8 | ``` 9 | {{ string | to_tabs }} 10 | {{ string | to_tabs:4 }} 11 | ``` 12 | -------------------------------------------------------------------------------- /content/collections/tags/user.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: User 3 | description: Alias of the `user:profile` Tag. 4 | overview: > 5 | User tags are designed to output and update user details, handle registration and authentication, and more. 6 | id: fcdfb1e0-5cf5-4669-9c00-3064e43cb630 7 | is_parent_tag: true 8 | --- 9 | The `user` tag on its own is an alias of the [`user:profile`](/tags/user-profile) Tag. 10 | -------------------------------------------------------------------------------- /content/collections/variables/id.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - content 4 | id: a7a7a927-fd46-4b01-887b-99d4ce5f8e1e 5 | --- 6 | The ID is the identifier of the content. It's usually a long number that you wouldn't want to show anyone. 7 | However it's super handy to pass into other tags. 8 | 9 | ``` 10 | {{ id }} 11 | ``` 12 | 13 | ``` .language-output 14 | 0020c540-d4cd-11e5-a837-0800200c9a66 15 | ``` 16 | -------------------------------------------------------------------------------- /content/collections/modifiers/first.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | - string 5 | - utility 6 | id: 3ef1e731-742e-48c2-81f0-6fa916ecda0a 7 | --- 8 | Returns the first X characters of a string, where X is any positive integer. 9 | 10 | ```.language-yaml 11 | title: 2015 Year Books Photos 12 | ``` 13 | 14 | ``` 15 | {{ title | first:4 }} 16 | ``` 17 | 18 | ```.language-output 19 | 2015 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_blank.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - conditions 4 | id: 054a230c-a655-48b0-af8b-a963bb0b89b0 5 | --- 6 | Returns `true` if the string contains only whitespace chars. 7 | 8 | ```.language-yaml 9 | ghost: 10 | zombie: BRAINSSSS 11 | ``` 12 | 13 | ``` 14 | {{ if ghost | is_blank }} 15 | {{ if zombie | is_blank }} 16 | ``` 17 | 18 | ```.language-output 19 | true 20 | false 21 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/lower.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 14ef311c-b49a-45af-a0aa-e80f68793ba8 6 | --- 7 | Converts all characters in the string to lowercase. 8 | 9 | ```.language-yaml 10 | yelling: I DON'T KNOW WHAT WE'RE YELLING ABOUT 11 | ``` 12 | 13 | ``` 14 | {{ yelling | lower }} 15 | ``` 16 | 17 | ```.language-output 18 | i don't know what we're yelling about 19 | ``` -------------------------------------------------------------------------------- /content/collections/variables/environment.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 8426c6e0-6641-11e6-bdf4-0800200c9a66 3 | types: 4 | - global 5 | --- 6 | Outputs the current environment. 7 | 8 | This will be the value of `APP_ENV` in your `.env` file. If you haven't set that, then it will output the default of `production`. 9 | 10 | ``` 11 | {{ environment }} 12 | ``` 13 | 14 | ``` .language-output 15 | production 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/modifiers/deslugify.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 826517cc-7273-4045-bca2-fe5825fd9bda 5 | --- 6 | Replaces all hyphens and underscores in a string with spaces. The opposite of [dashify](#dashify). 7 | 8 | ```.language-yaml 9 | title: Just-Because-I-Can 10 | ``` 11 | 12 | ``` 13 | {{ title | deslugify }} 14 | ``` 15 | 16 | ```.language-output 17 | Just Because I Can 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/insert.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: fa936f49-be25-432e-9543-7a201a652055 6 | --- 7 | Inserts a string at the position provided. The beginning of the string is position 0. 8 | 9 | ```.language-yaml 10 | opinion: This is yummy. 11 | ``` 12 | 13 | ``` 14 | {{ opinion insert="not |8" }} 15 | ``` 16 | 17 | ```.language-output 18 | This is not yummy. 19 | ``` -------------------------------------------------------------------------------- /content/collections/variables/datestamp.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: 2a5f5263-e61b-47bb-8c45-c02cd49554d6 5 | --- 6 | Get the timestamp of the entry. This will be an integer. 7 | 8 | Alias of `timestamp`. Maybe calling it a datestamp makes more sense to you if you aren't using time-based entries. 9 | 10 | ``` 11 | {{ datestamp }} 12 | ``` 13 | 14 | ``` .language-output 15 | 1425772800 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/variables/order.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | - page 5 | id: 4d2aaabf-e845-4d29-bf8e-d2d4d2245945 6 | --- 7 | Get the order key of the content. It's what's at the beginning of the filename. 8 | 9 | For pages this could be a number. For entries it could be a number or a date string (2015-01-02). 10 | 11 | ``` 12 | {{ order }} 13 | ``` 14 | 15 | ``` .language-output 16 | 1 17 | ``` 18 | -------------------------------------------------------------------------------- /content/collections/events/cp-add-to-head.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: cp.add_to_head 3 | class: cp.add_to_head 4 | id: 356340bd-b4bc-4f61-a699-805f6194a0ac 5 | --- 6 | Fired on every CP request. Any strings returned will be added to the Control Panel’s `` element. Useful for adding early-loaded Javascript. 7 | 8 | ``` 9 | public $events = ['cp.add_to_head' => 'handle']; 10 | 11 | public function handle(); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/collections/modifiers/link.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | attributes: true 5 | id: 16312447-a597-4a98-9726-8e97718c9788 6 | --- 7 | Generate an HTML link element with the value as `href`. 8 | 9 | ```.language-yaml 10 | neat_site: http://example.com 11 | ``` 12 | 13 | ``` 14 | {{ neat_site | link }} 15 | ``` 16 | 17 | ```.language-output 18 | http://example.com 19 | ``` -------------------------------------------------------------------------------- /content/collections/variables/has_timestamp.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: 396883d6-a3bc-4d98-a5a0-894e744b0451 5 | --- 6 | A boolean for whether or not an entry is time-based. 7 | 8 | ``` 9 | {{ if has_timestamp }} 10 | {{ date format="F jS, Y g:i a" }} 11 | {{ else }} 12 | {{ date format="F jS, Y" }} 13 | {{ /if }} 14 | ``` 15 | 16 | ``` .language-output 17 | January 1st, 2016 11:30 am 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/widgets/updater.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Updater 3 | overview: Display whether any Statamic updates are available. 4 | description: Display whether any Statamic updates are available and give the option to update. 5 | id: ce249b1a-1884-4d5b-b1df-8715093cf9e6 6 | --- 7 | This widget will simply tell you if there are any Statamic updates available. 8 | 9 | No parameters are available for this widget. 10 | -------------------------------------------------------------------------------- /content/collections/modifiers/has_lower_case.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - condition 4 | id: a5ce6691-840c-4bf7-b5f4-b87bb4845055 5 | --- 6 | Returns `true` if the string contains a lowercase character, `false` otherwise. 7 | 8 | ```.language-yaml 9 | loud_noises: "I DON'T KNOW WHAT WE'RE YELLING ABOUT!" 10 | ``` 11 | 12 | ``` 13 | {{ if loud_noises | has_lower_case }} 14 | ``` 15 | 16 | ```.language-output 17 | false 18 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/has_upper_case.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - condition 4 | id: b2936dd3-f8b1-44a7-bb40-f3b0a8b47e90 5 | --- 6 | Returns `true` if the string contains an uppercase character, `false` otherwise. 7 | 8 | ```.language-yaml 9 | loud_noises: "I DON'T KNOW WHAT WE'RE YELLING ABOUT!" 10 | ``` 11 | 12 | ``` 13 | {{ if loud_noises | has_upper_case }} 14 | ``` 15 | 16 | ```.language-output 17 | true 18 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/is_past.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: fbf6eab4-0769-4e13-9205-f9f64fd44572 6 | --- 7 | Returns `true` if date is in the past. 8 | 9 | ```.language-yaml 10 | date: October 21 2015 11 | another_date: November 2019 12 | ``` 13 | 14 | ``` 15 | {{ if date | is_past }} 16 | {{ if another_date | is_past }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` -------------------------------------------------------------------------------- /content/collections/variables/locale.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: abe54934-3204-4cd3-bf4d-d9ef1d2c5738 3 | types: 4 | - global 5 | --- 6 | The site's locale key as defined in your `system.yaml`'s `locales` array. 7 | 8 | ``` .language-yaml 9 | locales: 10 | en: 11 | name: English 12 | full: en_US 13 | url: http://mysite.com/ 14 | ``` 15 | 16 | ``` 17 | {{ locale }} 18 | ``` 19 | 20 | ``` .language-output 21 | en 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_future.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: 26bf98af-5bc1-4ec9-b533-815872606e3b 6 | --- 7 | Returns `true` if date is in the future. 8 | 9 | ```.language-yaml 10 | date: October 21 2015 11 | another_date: November 2019 12 | ``` 13 | 14 | ``` 15 | {{ if date | is_future }} 16 | {{ if another_date | is_future }} 17 | ``` 18 | 19 | ```.language-output 20 | false 21 | true 22 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/is_lowercase.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: 97ff9a80-1e19-4f6d-b9e8-b5f4223e19d7 6 | --- 7 | Returns `true` if string is only lowercase characters. 8 | 9 | ```.language-yaml 10 | topic: fhqwhgads 11 | from: Sibbie 12 | ``` 13 | 14 | ``` 15 | {{ if topic | is_lowercase }} 16 | {{ if from | is_lowercase }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/trim.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 64e41d8f-fedb-4639-bb09-d4e4cbfe3555 5 | --- 6 | Returns a string with whitespace removed from the start and end of the string. Supports the removal of unicode whitespace. 7 | 8 | ```.language-yaml 9 | string: " This is so sloppy " 10 | ``` 11 | 12 | ``` 13 | {{ string | trim }} 14 | ``` 15 | 16 | ```.language-output 17 | This is so sloppy 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/variables/date.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - entry 4 | id: 01b2a925-3f4e-473c-a983-ff8c29c8078f 5 | --- 6 | Get the date of the entry. This will be a `Carbon` instance. 7 | 8 | However if you use it in your template as-is, it will get converted to a string using the format defined in your 9 | system settings. 10 | 11 | ``` 12 | {{ date }} 13 | ``` 14 | 15 | ``` .language-output 16 | February 16, 2016 17 | ``` 18 | -------------------------------------------------------------------------------- /content/collections/variables/xml_header.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 81617b1f-000e-4d18-b5ea-592b9d845ccb 3 | types: 4 | - global 5 | --- 6 | Simply outputs an XML Header tag. 7 | 8 | Statamic's template parser will encode `` because they are PHP tags. Silly XML. This global will get you around that. 9 | 10 | ``` 11 | {{ xml_header }} 12 | ``` 13 | 14 | ``` .language-output 15 | 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_url.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: 85303071-213b-4e6c-8fb7-10f703a4a52e 6 | --- 7 | Returns `true` if a string is a valid URL. 8 | 9 | ```.language-yaml 10 | a_url: http://google.com/ 11 | not_a_url: waffles 12 | ``` 13 | 14 | ``` 15 | {{ if a_url | is_url }} 16 | {{ if not_a_url | is_url }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/urldecode.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: bf5018c9-3c15-4f93-927d-0ad3f728ac50 6 | --- 7 | URL-decodes a string. The inverse of [urlencode](#urlencode) 8 | 9 | ```.language-yaml 10 | string: I+just+want+%26+need+%24pecial+characters%21 11 | ``` 12 | 13 | ``` 14 | {{ string | urldecode }} 15 | ``` 16 | 17 | ```.language-output 18 | I just want & need $pecial characters! 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/modifiers/urlencode.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: b27e8b53-f9bd-471d-8f36-17d51ec11a32 6 | --- 7 | URL-encodes a string. The inverse of [urldecode](#urldecode) 8 | 9 | ```.language-yaml 10 | string: I just want & need $pecial characters! 11 | ``` 12 | 13 | ``` 14 | {{ string | urlencode }} 15 | ``` 16 | 17 | ```.language-output 18 | I+just+want+%26+need+%24pecial+characters%21 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/variables/csrf_field.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - global 4 | id: 344d0518-9deb-4bfc-ac62-fe48a9304a81 5 | --- 6 | A helper to output the CSRF token inside a hidden field named `_token` from the session. 7 | 8 | POST requests in Statamic will be keeping an eye out for a `_token` value. 9 | 10 | ``` 11 | {{ csrf_field }} 12 | ``` 13 | 14 | ``` 15 | 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_uppercase.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: d5635238-7d7a-4543-9afc-912bee6ad6fd 6 | --- 7 | Returns `true` if string is only uppercase characters. 8 | 9 | ```.language-yaml 10 | declaration: NOISES 11 | cite: anonymous 12 | ``` 13 | 14 | ``` 15 | {{ if declaration | is_uppercase }} 16 | {{ if cite | is_uppercase }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/nl2br.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - markup 5 | attributes: true 6 | id: ecbf79c1-be5d-412e-a677-30a847cfffa6 7 | --- 8 | Replaces line breaks with `
` tags. 9 | 10 | ```.language-yaml 11 | summary: | 12 | This is a summary 13 | on multiple lines 14 | ``` 15 | 16 | ``` 17 | {{ summary | nl2br }} 18 | ``` 19 | 20 | ```.language-output 21 | This is a summary 22 | on multiple lines 23 | ``` 24 | -------------------------------------------------------------------------------- /content/collections/variables/last_modified.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 026f77b4-ab22-4c5f-b3be-ebc452e25c5b 3 | types: 4 | - content 5 | --- 6 | The last modified time for the content file, or the asset. 7 | 8 | Note that this is the timestamp for the file itself, not for when the content was published or updated. For example, 9 | if you were to use git to deploy this file and it gets written on a server, the last modified time will be different. 10 | -------------------------------------------------------------------------------- /content/collections/modifiers/favicon.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | attributes: true 5 | id: 9c7ad945-2d02-423b-ae97-09cbe7ffed0d 6 | --- 7 | Given a valid URL will generate a proper favicon meta tag. 8 | 9 | ```.language-yaml 10 | icon: /assets/img/favicon.png 11 | ``` 12 | 13 | ``` 14 | {{ icon | favicon }} 15 | ``` 16 | 17 | ```.language-output 18 | 19 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/list.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - markup 5 | id: d8a8568c-bb93-4e84-8d30-e527b3b02876 6 | --- 7 | Turn a simple array into a comma delimited list with no comma after the last item. 8 | 9 | ```.language-yaml 10 | things: 11 | - batman 12 | - zombies 13 | - scrunchies 14 | ``` 15 | 16 | ``` 17 | {{ things | list }} 18 | ``` 19 | 20 | ```.language-output 21 | batman, zombies, scrunchies 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/modifiers/round.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | - utility 5 | id: 5166ff7e-2fad-414c-b232-f04108c08900 6 | --- 7 | Rounds a number to a specified precision (number of digits after the decimal point). Defaults to `0`, or whole numbers. 8 | 9 | ```.language-yaml 10 | pi: 3.14159265359 11 | ``` 12 | 13 | ``` 14 | {{ pi | round }} 15 | {{ pi | round:2 }} 16 | ``` 17 | 18 | ```.language-output 19 | 3 20 | 3.14 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/variables/locale_full.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - global 4 | id: 5b84efbc-59d9-48af-9905-90b461c3c44f 5 | --- 6 | The site's full locale value as defined in your `system.yaml`'s `locales` array. 7 | 8 | ``` .language-yaml 9 | locales: 10 | en: 11 | name: English 12 | full: en_US 13 | url: http://mysite.com/ 14 | ``` 15 | 16 | ``` 17 | {{ locale_full }} 18 | ``` 19 | 20 | ``` .language-output 21 | en_US 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/variables/locale_name.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - global 4 | id: 2cd42640-5c57-4bbe-a56b-bb234b8a31c2 5 | --- 6 | The site's locale name as defined in your `system.yaml`'s `locales` array. 7 | 8 | ``` .language-yaml 9 | locales: 10 | en: 11 | name: English 12 | full: en_US 13 | url: http://mysite.com/ 14 | ``` 15 | 16 | ``` 17 | {{ locale_name }} 18 | ``` 19 | 20 | ``` .language-output 21 | English 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/events/search-query-performed.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: SearchQueryPerformed 3 | class: Statamic\Events\SearchQueryPerformed 4 | id: c71c535a-a549-4457-ac3c-e95bd13fe54f 5 | --- 6 | Fired when a search is performed. 7 | 8 | ``` 9 | public $events = [SearchQueryPerformed::class => 'handle']; 10 | 11 | public function handle(SearchQueryPerformed $event) 12 | { 13 | $event->query; // the string that was searched for 14 | } 15 | ``` 16 | -------------------------------------------------------------------------------- /content/collections/modifiers/image.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | - markup 5 | attributes: true 6 | id: 26045669-567d-4e93-b3ba-34c835f5c5e9 7 | --- 8 | Generate an HTML image element with the variable's value as `src`. 9 | 10 | ```.language-yaml 11 | header_image: /assets/img/bokeh-bunnies.jpg 12 | ``` 13 | 14 | ``` 15 | {{ header_image | image }} 16 | ``` 17 | 18 | ```.language-output 19 | 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/ol.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - markup 5 | id: 327f4a3b-04d4-4069-881a-fe50ddb9be23 6 | --- 7 | Turn an array into an HTML ordered list element. 8 | 9 | ```.language-yaml 10 | food: 11 | - sushi 12 | - broccoli 13 | - kale 14 | ``` 15 | 16 | ``` 17 | {{ food | ol }} 18 | ``` 19 | 20 | ```.language-output 21 |
    22 |
  1. sushi
  2. 23 |
  3. broccoli
  4. 24 |
  5. kale 25 |
26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/variables/locale_url.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - global 4 | id: ccf276e6-34a9-4be2-ba0a-911f5e577eff 5 | --- 6 | The site's locale url as defined in your `system.yaml`'s `locales` array. 7 | 8 | ``` .language-yaml 9 | locales: 10 | en: 11 | name: English 12 | full: en_US 13 | url: http://mysite.com/ 14 | ``` 15 | 16 | ``` 17 | {{ locale_url }} 18 | ``` 19 | 20 | ``` .language-output 21 | http://mysite.com/ 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/modifiers/divide.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | id: fedbc5fc-2478-4fba-92ba-4004bc6e8845 5 | --- 6 | Divide a value or another variable by your variable. Pass an integer or the name of a second variable as the parameter. 7 | 8 | ```.language-yaml 9 | bacon: 21 10 | skillets: 3 11 | ``` 12 | 13 | ``` 14 | {{ bacon divide="skillets" }} 15 | {{ skillets divide="3" }} 16 | ``` 17 | 18 | ```.language-output 19 | 7 20 | 1 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/regex_replace.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 711d7eb2-8748-42a8-90c6-c91efb3ed818 6 | --- 7 | Run a find and replace regex on a string of content. 8 | 9 | ```.language-yaml 10 | description: This cat video is the best thing ever. 11 | ``` 12 | 13 | ``` 14 | {{ description regex_replace="best|okayest" }} 15 | ``` 16 | 17 | ```.language-output 18 | This cat video is the okayest thing ever. 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/modifiers/ul.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - markup 5 | id: 85910466-876b-4fc7-9dd1-c9baa7f7870a 6 | --- 7 | Turn an array into an HTML unordered list element. 8 | 9 | ```.language-yaml 10 | food: 11 | - sushi 12 | - broccoli 13 | - kale 14 | ``` 15 | 16 | ``` 17 | {{ food | ul }} 18 | ``` 19 | 20 | ```.language-output 21 | 26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/tags/dump.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Dump 3 | overview: Dump all the variables in the current context. 4 | id: 32bc9a50-3b12-11e6-bdf4-0800200c9a66 5 | --- 6 | 7 | This tag is useful for debugging, and not much more. It will simply stop execution of the page and show you all the variables in the current context. 8 | 9 | ``` 10 | {{ dump }} 11 | ``` 12 | 13 | You can also use the [dump modifier](/modifiers/dump) to achieve a similar effect. 14 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_email.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: 471b3281-4573-43ee-9fee-eb55edf26ad0 6 | --- 7 | Returns `true` if a string is a valid email address. 8 | 9 | ```.language-yaml 10 | an_email: lknope@inpra.org 11 | not_an_email: waffles 12 | ``` 13 | 14 | ``` 15 | {{ if an_email | is_email }} 16 | {{ if not_an_email | is_email }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` 23 | 24 | 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/remove_left.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 71feed11-dcb7-4405-8f50-a17cb4c021ef 6 | --- 7 | Ensures that the string never begins with a specified string. 8 | 9 | ```.language-yaml 10 | twitter: @statamic 11 | ``` 12 | 13 | ``` 14 | Twitter 15 | ``` 16 | 17 | ```.language-output 18 | Twitter 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_yesterday.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: bd468407-617a-4cb8-93d8-cfd7148ec157 6 | parse_content: true 7 | --- 8 | Returns `true` if date is yesterday - using the server's time. 9 | 10 | ```.language-yaml 11 | date: {{ now modify_date="-1 day" format="F j Y" }} 12 | ``` 13 | {{ noparse }} 14 | ``` 15 | {{ if date | is_yesterday }} 16 | ``` 17 | {{ /noparse }} 18 | 19 | ```.language-output 20 | true 21 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/replace.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: ab02d964-9a39-4f2b-ae87-d5248af9101e 6 | --- 7 | Find and replace all occurrences of a string with a totally different string. 8 | 9 | ```.language-yaml 10 | description: This cat video is the okayest thing ever. 11 | ``` 12 | 13 | ``` 14 | {{ description replace="cat|dog" }} 15 | ``` 16 | 17 | ```.language-output 18 | This dog video is the okayest thing ever. 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/modifiers/tidy.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: be5541eb-4e33-4699-8035-61ce09de3247 6 | --- 7 | Returns a string with smart quotes, ellipsis characters, and dashes from Windows-1252 (commonly used in Word documents) replaced by their ASCII equivalents. 8 | 9 | ```.language-yaml 10 | string: > 11 | “I see…” 12 | ``` 13 | 14 | ``` 15 | {{ string | tidy }} 16 | ``` 17 | 18 | ```.language-output 19 | "I see..." 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/events/form-submission.created.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Form.submission.created 3 | class: Form.submission.created 4 | id: 1f723274-fdab-47e2-ac63-d175f2b5be74 5 | --- 6 | Fired when the submission is successfully saved. The `Submission` object is passed through. 7 | 8 | ``` 9 | use Statamic\Contracts\Forms\Submission; 10 | 11 | public $events = ['Form.submission.created' => 'handle']; 12 | 13 | public function handle(Submission $submission); 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/modifiers/cdata.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: f1b59bce-43e7-41a4-b82f-e16016d90b18 6 | --- 7 | Wraps a string in [CDATA][cdata] tags, useful for formatting characters properly in XML. 8 | 9 | ```.language-yaml 10 | title: My Very Own Podcast 11 | ``` 12 | 13 | ``` 14 | {{ title | cdata }} 15 | ``` 16 | 17 | ```.language-output 18 | 19 | ``` 20 | 21 | [cdata]: https://en.wikipedia.org/wiki/CDATA -------------------------------------------------------------------------------- /content/collections/modifiers/console_log.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | id: 985dc29c-fe71-464e-bb83-4f3f2aa455c0 5 | --- 6 | Debug a variable by dumping its contents to your browser's JavaScript's console via `console.log`. 7 | 8 | ```.language-yaml 9 | fruit: 10 | - apples 11 | - bananas 12 | - bacon 13 | ``` 14 | 15 | ``` 16 | {{ fruit | console_log }} 17 | ``` 18 | 19 | ```.language-javascript 20 | ["apples", "banana", "jerky"] 21 | ``` 22 | 23 | 24 | -------------------------------------------------------------------------------- /content/collections/events/cp-nav-created.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: cp.nav.created 3 | class: cp.nav.created 4 | id: eb5217f2-41d1-4c24-ae0b-4c779f48f16a 5 | --- 6 | Fired after the navigation has been created. A `Statamic\CP\Navigation\Nav` object will be passed through. 7 | 8 | Use this event to [add your own items to the navigation](/addons/control-panel). 9 | 10 | ``` 11 | public $events = ['cp.nav.created' => 'handle']; 12 | 13 | public function handle(Nav $nav); 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/modifiers/ends_with.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - condition 4 | id: 40fc5b1e-d0e7-488a-bf6e-e6ef4a8b7dd8 5 | --- 6 | Returns `true` if the value ends with a given string. This comparison is case-insensitive. 7 | 8 | ```.language-yaml 9 | punchline: That's what she said! 10 | ``` 11 | 12 | ``` 13 | {{ if (punchline | ends_with:she said!) }} 14 | {{ if (punchline | ends_with:your mom!) }} 15 | ``` 16 | 17 | ```.language-output 18 | true 19 | false 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_numeric.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: 02db0ee5-585b-4e40-ab2b-f15a596b341c 6 | --- 7 | Returns `true` if variable is a number or numeric string. 8 | 9 | ```.language-yaml 10 | sequence: 4815162342 11 | another_sequence: just type 4 8 15 16 23 42 12 | ``` 13 | 14 | ``` 15 | {{ if sequence | is_numeric }} 16 | {{ if another_sequence | is_numeric }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` -------------------------------------------------------------------------------- /content/collections/tags/theme.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Theme 3 | description: Get the name of your theme. 4 | overview: > 5 | A theme is the perfectly fitting custom tailored suit that your website wears. 6 | id: 419711d5-668f-4dfc-80bd-b4ab8ff59e9c 7 | is_parent_tag: true 8 | --- 9 | ## Theme Name {#theme-name} 10 | Using `{{ theme }}` on its own will output the name of your theme. 11 | 12 | ``` 13 | {{ theme }} 14 | ``` 15 | 16 | ``` .language-output 17 | redwood 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/tags/user-logout_url.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Logout URL 3 | overview: Generates a user's logout URL. 4 | parameters: 5 | - 6 | name: redirect 7 | type: string 8 | description: > 9 | Where the user should be redirected 10 | after logging out. Defaults to the home 11 | page. 12 | id: 232b878c-18da-4d01-80f3-a85fcdf65ed8 13 | --- 14 | ## Example {#example} 15 | 16 | ``` 17 | Log out 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/events/glide-generated.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: glide.generated 3 | class: glide.generated 4 | id: 5ef3b6c0-323b-4276-b478-6a95dd74f537 5 | --- 6 | Fired after Glide has generated an image. The parameters will be `$path` - which will be the full path to the cached image, and `$params` - an array of query parameters used to generate the image. 7 | 8 | ``` 9 | public $events = ['glide.generated' => 'handle']; 10 | 11 | public function handle($path, $params); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/collections/modifiers/ampersand_list.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - markup 5 | id: cbab1bb5-302e-499d-badb-f154dbae751d 6 | --- 7 | Turn a simple array into a comma delimited string with a friendly little ampersand between the last two items. 8 | 9 | ```.language-yaml 10 | fruits: 11 | - apples 12 | - bananas 13 | - jerky 14 | ``` 15 | 16 | ``` 17 | {{ fruits | ampersand_list }} 18 | ``` 19 | 20 | ```.language-output 21 | apples, bananas & jerky 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/modifiers/background_position.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | - string 5 | id: 0904f610-eee8-4b86-827b-0dc281d553ca 6 | --- 7 | Converts an asset focal point value (eg. `50-30`) into a value suitable for the background-position css property. 8 | 9 | ```.language-yaml 10 | focus: 50-30 11 | ``` 12 | 13 | ``` 14 | background-position: {{ focus | background_position }}; 15 | ``` 16 | 17 | ```.language-output 18 | background-position: 50% 30%; 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/modifiers/contains_any.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - condition 4 | id: 20ac3e9a-4a45-4c2f-9052-be222fc84016 5 | --- 6 | Search a string against multiple needles and return `true` if any are found, otherwise `false`. Case-insensitive. 7 | 8 | ```.language-yaml 9 | summary: "It was the best of times, it was the worst of times." 10 | ``` 11 | 12 | ``` 13 | {{ if summary | contains_any:good:better:best }} 14 | ``` 15 | 16 | ```.language-output 17 | true 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/tags/nav-exists.md: -------------------------------------------------------------------------------- 1 | --- 2 | overview: Test whether a set of parameters will result in a page tree. 3 | title: Exists 4 | id: b0275e02-2a64-4233-a335-1da161f23216 5 | --- 6 | It's useful for checking whether or not a certain tree should be displayed. 7 | It uses the same parameters to the `nav` tag. 8 | 9 | ## Example 10 | 11 | ``` 12 | {{ nav:exists from="/foo" }} 13 | This will be displayed if the requested nav exists. 14 | {{ /nav:exists }} 15 | ``` 16 | -------------------------------------------------------------------------------- /content/collections/tags/theme-output.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Output 3 | overview: Render the output of any file in your theme. 4 | parameters: 5 | - 6 | name: src 7 | type: string 8 | description: > 9 | The path to the file, relative to the 10 | theme directory. 11 | id: 3cb29c4f-96d2-4c6f-8e83-51facf2ae8ab 12 | --- 13 | ## Example {#example} 14 | ``` 15 | {{ theme:output src="svg/logo.svg" }} 16 | ``` 17 | ``` .language-output 18 | ... 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/kb/reset-password.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Resetting Your Password 3 | id: 53965b39-0e0c-4435-8b1e-b667bf09cb30 4 | kb_categories: 5 | - Tips, Tricks, and How-Tos 6 | --- 7 | Forgot your admin user's password? No problem. 8 | 9 | Open `site/users/.yaml`, remove `password_hash`, and set a new password like so: 10 | 11 | ``` 12 | password: supersecretpassword! 13 | ``` 14 | 15 | Once you login it'll be encrypted and you'll be on your way, safe and sound. 16 | -------------------------------------------------------------------------------- /content/collections/modifiers/length.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 9002885e-20e9-4d1c-8396-1c8011076d2c 6 | --- 7 | Returns the number of items in an array or characters in a string. 8 | 9 | ```.language-yaml 10 | array: 11 | - Taylor Swift 12 | - Left Shark 13 | - Leroy Jenkins 14 | string: LEEEEROOOYYYY JEEENKINNNSS! 15 | ``` 16 | 17 | ``` 18 | {{ array | length }} 19 | {{ string | length }} 20 | ``` 21 | 22 | ```.language-output 23 | 3 24 | 27 25 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/option_list.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: 6866c25b-1266-4908-8325-dce4e5146f5b 6 | --- 7 | Turn an array into a pipe-delimited string. Useful when passing an array of things into a parameter. 8 | 9 | ```.language-yaml 10 | collections: 11 | - blog 12 | - news 13 | - wigs 14 | ``` 15 | 16 | ``` 17 | {{ collection from="{collections|option_list}" }} 18 | ``` 19 | 20 | Can also be used by its alias, [`piped`](/modifiers/piped). 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/ascii.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 807d2a16-dbaa-4aaf-887c-9682b63a6af8 5 | --- 6 | Replaces all non-ASCII characters with their closest ASCII counterparts and removes any unsupported characters completely. This is very useful for converting foreign language strings into something more code-friendly. 7 | 8 | ```.language-yaml 9 | title: lemoñade 10 | ``` 11 | 12 | ``` 13 | {{ title | ascii }} 14 | ``` 15 | 16 | ```.language-output 17 | lemonade 18 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/is_leap_year.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: 0438995d-7100-4a72-9c0c-985e00f482bb 6 | --- 7 | Returns `true` if date is in a leap year. Try and find a regular use for this one, we dare you. 8 | 9 | ```.language-yaml 10 | date: November 2016 11 | another_date: November 2017 12 | ``` 13 | 14 | ``` 15 | {{ if date | is_leap_year }} 16 | {{ if another_date | is_leap_year }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/remove_right.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: ec6e096f-ee52-449e-96b5-e0d759f982f0 6 | --- 7 | Ensures that the string never ends with a specified string. 8 | 9 | ```.language-yaml 10 | urls: 11 | - http://statamic.com/ 12 | - http://laravel.com/ 13 | ``` 14 | 15 | ``` 16 | {{ urls }} 17 | {{ value | remove_right:/ }} 18 | {{ /urls }} 19 | ``` 20 | 21 | ```.language-output 22 | http://statamic.com 23 | http://laravel.com 24 | ``` 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/sentence_list.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - markup 5 | id: eed4c5bc-0923-4f54-ad37-ca9a3384e1e0 6 | --- 7 | Turn a simple array into a friendly comma delimited list with the word "and" before the last item. 8 | 9 | ```.language-yaml 10 | things: 11 | - batman 12 | - zombies 13 | - scrunchies 14 | ``` 15 | 16 | ``` 17 | I like {{ things | sentence_list }}. 18 | ``` 19 | 20 | ```.language-output 21 | I like batman, zombies, and scrunchies. 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/variables/now.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: cbf3a055-9714-4f0f-a33b-508c59b4e1f8 3 | types: 4 | - global 5 | --- 6 | The current date/time. If you use it on its own, it will be formatted using the default time format. If you pass it into a tag parameter or modifier, it will be treated as the `Carbon` instance. 7 | 8 | ``` 9 | {{ now }} 10 | ``` 11 | 12 | ``` .language-output 13 | December 30th 2015 14 | ``` 15 | 16 | Also available as `{{ today }}` and `{{ current_date }}` aliases. 17 | -------------------------------------------------------------------------------- /content/collections/modifiers/sanitize.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 9b9a3494-ebb0-4e28-95d3-6d7986b0386e 6 | --- 7 | Convert special characters to HTML entities with [htmlspecialchars][htmlspecialchars]. 8 | 9 | ```.language-yaml 10 | example: NEAT 11 | ``` 12 | 13 | ``` 14 | {{ example | sanitize }} 15 | ``` 16 | 17 | ```.language-output 18 | <b>NEAT<b> 19 | ``` 20 | 21 | [htmlspecialchars]: http://php.net/manual/en/function.htmlspecialchars.php 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/starts_with.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - condition 4 | id: 1b1581b6-859f-4559-850b-398b7437929a 5 | --- 6 | Returns `true` if the value starts with a given string. This comparison is case-insensitive. 7 | 8 | ```.language-yaml 9 | reply: Actually, I disagree because this is the internet. 10 | ``` 11 | 12 | ``` 13 | {{ if reply | starts_with:actually }} 14 | {{ if reply | starts_with:respectfully }} 15 | ``` 16 | 17 | ```.language-output 18 | true 19 | false 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/mailto.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | attributes: true 5 | id: 65bcc454-2731-4f83-97cf-03659fb38db5 6 | --- 7 | Generate a `mailto` link element with the value as the email address. If it's _not_ an email address, it's going to be one busted link. 8 | 9 | ```.language-yaml 10 | holler: holler@example.com 11 | ``` 12 | 13 | ``` 14 | {{ holler | mailto }} 15 | ``` 16 | 17 | ```.language-output 18 | holler@example.com 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/docs/tour.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Statamic Tour 3 | overview: "Let's casually explore a fresh Statamic install and cover the folder structure, control panel, basic settings, user account creation, and more." 4 | id: 1fb7eccd-11e1-43bd-bcf9-b0094b153829 5 | --- 6 |
7 |
8 | 9 |
10 |
11 | -------------------------------------------------------------------------------- /content/collections/events/asset-container-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AssetContainerSaved 3 | class: Statamic\Events\Data\AssetContainerSaved 4 | id: 2f2863f2-d32f-42d2-bd95-ed53760bfa1c 5 | --- 6 | This is a [data event](/addons/events#data-events) that is dispatched when an asset container has been saved. 7 | 8 | ``` 9 | public function handle(AssetContainerSaved $event) 10 | { 11 | // In addition to data event methods, you get: 12 | $event->container; // The asset container object. 13 | } 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/section.md: -------------------------------------------------------------------------------- 1 | title: Section 2 | description: A simple visual header to help organize long publish forms. 3 | overview: "The Section fieldtype is perfect for giving your fields some breathing room and organization. It serves as a visual break in the publish form as a section header allowing you to group your fields into various sections. You'd be surprised how much this can help your content managers." 4 | image: /assets/fieldtypes/section.jpg 5 | id: 88b0d4a4-e81a-4e84-8a01-fc90f54202a5 6 | -------------------------------------------------------------------------------- /content/collections/modifiers/explode.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - array 5 | id: c3d3e2c4-218e-4841-a594-647f10863866 6 | --- 7 | Breaks a string into an array of strings split on a given delimiter. 8 | 9 | ```.language-yaml 10 | places: Scotland, England, Switzerland, Italy 11 | ``` 12 | 13 | ``` 14 | {{ places | explode:, | ul }} 15 | ``` 16 | 17 | ```.language-html 18 | 24 | ``` 25 | -------------------------------------------------------------------------------- /content/collections/tags/markdown.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown 3 | id: 3f0e8d63-f6ca-4a8e-86dd-8361aa328807 4 | overview: Convert content between the tags from markdown into HTML. 5 | --- 6 | This is a tag-pair version of the [markdown modifier](/modifiers/markdown). 7 | 8 | ## Example {#example} 9 | 10 | ``` 11 | {{ markdown }} 12 | ## Ode To Bacon 13 | 14 | Bacon. Mmm, bacon. 15 | {{ /markdown }} 16 | ``` 17 | 18 | ``` .language-output 19 |

Ode To Bacon

20 |

Bacon. Mmm, bacon.

21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/classes/pagefactory.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PageFactory 3 | class: Statamic\Data\Pages\PageFactory 4 | id: d64d4654-939e-47f4-90a1-b44a4978f0aa 5 | --- 6 | Inheritance: [ContentFactory](/addons/api/contentfactory) 7 | 8 | ## Usage 9 | 10 | Create a `PageFactory` using the API class. You should pass the URI into the `create` method. 11 | 12 | ``` 13 | $factory = Statamic\API\Page::create('/about'); 14 | ``` 15 | 16 | ## Available Methods 17 | 18 | There are no additional methods on this class. 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/add.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | id: 53debd55-5d53-4254-ad86-49a26cb09594 5 | --- 6 | Add a value or another variable to your variable. Pass an integer or the name of a second variable as the parameter. Also supports `+` as shorthand. 7 | 8 | ```.language-yaml 9 | books: 5 10 | magazines: 10 11 | ``` 12 | 13 | ``` 14 | {{ books | add:5 }} 15 | {{ books | add:magazines }} 16 | {{ books | +:magazines }} 17 | ``` 18 | 19 | ```.language-output 20 | 10 21 | 15 22 | 15 23 | ``` 24 | -------------------------------------------------------------------------------- /content/collections/modifiers/ensure_right.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 6854539a-4661-483b-bb1f-2d28df0db76e 6 | --- 7 | Ensures that the string ends with a specified string. If it doesn't, it will now. 8 | 9 | ```.language-yaml 10 | links: 11 | - statamic 12 | - wilderborn.com 13 | ``` 14 | 15 | ``` 16 | {{ links }} 17 |
  • {{ value ensure_right=".com" }}
  • 18 | {{ /links }} 19 | ``` 20 | 21 | ```.language-output 22 |
  • statamic.com
  • 23 |
  • wilderborn.com
  • 24 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/is_today.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: 50aa52bf-8c6c-4ec3-9af7-e610f65f8202 6 | parse_content: true 7 | --- 8 | Returns `true` if date is today - using the server's time. 9 | 10 | ```.language-yaml 11 | date: {{ now format="F j Y" }} 12 | another_date: November 6 2015 13 | ``` 14 | {{ noparse }} 15 | ``` 16 | {{ if date | is_today }} 17 | {{ if another_date | is_today }} 18 | ``` 19 | {{ /noparse }} 20 | 21 | ```.language-output 22 | true 23 | false 24 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/unique.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: f1486fa5-7cce-4c75-90cd-e131f5f6d184 6 | --- 7 | Returns all of the unique items in the array: 8 | 9 | ```.language-yaml 10 | checklist: 11 | - zebra 12 | - hippo 13 | - hyena 14 | - giraffe 15 | - zebra 16 | - hippo 17 | - hippo 18 | - hippo 19 | - hippo 20 | 21 | ``` 22 | 23 | ``` 24 | {{ checklist | unique | list }} 25 | ``` 26 | 27 | ```.language-output 28 | zebra, hippo, hyena, giraffe 29 | ``` 30 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_between.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: cfbf8926-47ee-42e1-a972-86e3dc13633b 6 | --- 7 | Returns `true` if a date variable is between two other dates. Those dates can be the name of other variables or literal date strings. 8 | 9 | ```.language-yaml 10 | date: November 15 2015 11 | start_date: July 4 2015 12 | end_date: December 1 2015 13 | ``` 14 | 15 | ``` 16 | {{ if date | is_between:start_date:end_date }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/collapse.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: ea17da24-79b9-4ac7-84ba-660b29f95899 6 | --- 7 | Collapses an array of arrays into a flat array. If duplicate keys exist they *will* get stomped over. 8 | 9 | ```.language-yaml 10 | numbers: 11 | - [one, two, three] 12 | - [four, five, six] 13 | ``` 14 | 15 | ``` 16 | {{ numbers | collapse }} 17 | ``` 18 | 19 | ```.language-yaml 20 | numbers: 21 | - one 22 | - two 23 | - three 24 | - four 25 | - five 26 | - six 27 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/dashify.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: e50e2b3a-4377-4a74-b25a-d1ecf5d2d04a 5 | --- 6 | Returns a lowercase and trimmed string separated by dashes. Dashes are inserted before uppercase characters (with the exception of the first character of the string), and in place of spaces as well as underscores. 7 | 8 | ```.language-yaml 9 | title: Just Because I Can 10 | ``` 11 | 12 | ``` 13 | {{ title | dashify }} 14 | ``` 15 | 16 | ```.language-output 17 | just-because-i-can 18 | ``` 19 | 20 | 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/multiply.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | id: b1241017-a321-42ad-b550-a49ae8b3a805 5 | --- 6 | Multiply a value or another variable to your variable. Pass an integer or the name of a second variable as the parameter. Also supports `*` as shorthand. 7 | 8 | ```.language-yaml 9 | smiles: 3 10 | winks: 4 11 | ``` 12 | 13 | ``` 14 | {{ smiles | multiply:10 }} 15 | {{ smiles | multiply:winks }} 16 | {{ smiles | *:winks }} 17 | 18 | ``` 19 | 20 | ```.language-output 21 | 30 22 | 12 23 | 12 24 | ``` 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/rawurlencode.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: a4bf0c06-9210-4200-881b-feb9011ea2f7 6 | --- 7 | 8 | URL-encode a variable according to [RFC 3986][rfc-3986]. 9 | ```.language-yaml 10 | example: please and thank you/Mommy 11 | ``` 12 | 13 | ``` 14 | http://example.com/{{ example | rawurlencode }} 15 | ``` 16 | 17 | ```.language-output 18 | http://example.com/please%20and%thank&20you%2FMommy 19 | ``` 20 | 21 | [rfc-3986]: http://php.net/manual/en/function.rawurlencode.php 22 | -------------------------------------------------------------------------------- /content/collections/classes/globalfactory.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: GlobalFactory 3 | class: Statamic\Data\Globals\GlobalFactory 4 | id: 2735b88d-6104-4b71-a281-9cb017bff7e2 5 | --- 6 | Inheritance: [ContentFactory](/addons/api/contentfactory) 7 | 8 | ## Usage 9 | 10 | Create a `GlobalFactory` using the API class. You should pass the handle/slug into the `create` method. 11 | 12 | ``` 13 | $factory = Statamic\API\Globals::create('common'); 14 | ``` 15 | 16 | ## Available Methods 17 | 18 | There are no additional methods on this class. 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/contains_all.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - condition 4 | id: e08b1034-5d58-4fae-8f6a-8efd9a65d6d9 5 | --- 6 | Search a string against multiple needles and return `true` if all are found, otherwise `false`. Case-insensitive. 7 | 8 | ```.language-yaml 9 | summary: "It was the best of times, it was the worst of times." 10 | ``` 11 | 12 | ``` 13 | {{ if summary | contains_all:best:worst }} 14 | {{ if summary | contains_all:best:better }} 15 | ``` 16 | 17 | ```.language-output 18 | true 19 | false 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/events/pages-moved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PagesMoved 3 | class: Statamic\Events\Data\PagesMoved 4 | id: 0e476aa7-4e41-462d-9eeb-a06df3533694 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when pages are moved when reordering the page tree. 7 | 8 | This event is dispatched once for the entire page tree reorder operation. The [PageMoved event](/addons/events/page-moved) 9 | will be dispatched for each affected page. 10 | 11 | ``` 12 | public function handle(PagesMoved $event); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/collections/modifiers/collapse_whitespace.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: bfc66a6c-e4f5-462b-822e-04c3402b5b8f 5 | --- 6 | Trims a string and replaces consecutive whitespace characters with 7 | a single space. This includes tabs and newline characters, as well as 8 | multibyte whitespace such as the thin space and ideographic space. 9 | 10 | ```.language-yaml 11 | title: Bad at typing 12 | ``` 13 | 14 | ``` 15 | {{ title | collapse_whitespace }} 16 | ``` 17 | 18 | ```.language-output 19 | Bad at typing 20 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/reverse.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 5ee6e776-5361-4d87-9227-c0461e33853f 6 | --- 7 | Reverse the order of the characters in a string or the items in an array. 8 | 9 | ```.language-yaml 10 | status: repaid 11 | order_of_ceremony: 12 | - photos 13 | - service 14 | - eat 15 | - party 16 | ``` 17 | 18 | ``` 19 | {{ status | reverse }} 20 | {{ order_of_ceremony | reverse | list }} 21 | ``` 22 | 23 | ```.language-output 24 | diaper 25 | party, eat, service, photos 26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/modifiers/days_ago.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: 811c1cf5-797f-4e77-af92-fde6c03e96d2 5 | parse_content: true 6 | --- 7 | Returns the number of days since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible. 8 | 9 | ```.language-yaml 10 | date: October 1 2015 11 | ``` 12 | 13 | {{ noparse }} 14 | ``` 15 | {{ date | days_ago }} 16 | ``` 17 | {{ /noparse }} 18 | 19 | ```.language-output 20 | {{ test_date | days_ago }} 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/ensure_left.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 171d9329-c456-45ca-a5e4-fc5bad7fb0ec 6 | --- 7 | Ensures that the string begins with a specified string. If it doesn't, it will now. 8 | 9 | ```.language-yaml 10 | links: 11 | - statamic.com 12 | - http://wilderborn.com 13 | ``` 14 | 15 | ``` 16 | {{ links }} 17 |
  • {{ value ensure_left="http://" }}
  • 18 | {{ /links }} 19 | ``` 20 | 21 | ```.language-output 22 |
  • http://statamic.com
  • 23 |
  • http://wilderborn.com
  • 24 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/substr.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 963d5e43-7bf5-4669-93af-d1990f7f3c97 6 | --- 7 | Returns the string beginning at a given position with an optional length. 8 | If length not specific, will return the rest of the string. 9 | 10 | ```.language-yaml 11 | string: How neat is that? 12 | ``` 13 | 14 | ``` 15 | {{ string | substr:0:3 }} 16 | {{ string | substr:4:4 }} 17 | {{ string | substr:-8:8 }} 18 | 19 | ``` 20 | 21 | ```.language-output 22 | How 23 | neat 24 | is that? 25 | ``` 26 | -------------------------------------------------------------------------------- /content/collections/events/deprecated-content-saved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: content.saved 3 | class: content.saved 4 | deprecated: true 5 | id: 912ac69b-83bf-4831-9083-e617520c0f3e 6 | --- 7 | See [ContentSaved](/addons/events/content-saved) 8 | 9 | Fired when any Page, Entry, Taxonomy Term, or Global is saved. The respective class will be passed through, along with original attributes from before it was updated. 10 | 11 | ``` 12 | public $events = ['content.saved' => 'handle']; 13 | 14 | public function handle(Content $content, $original); 15 | ``` 16 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/radio.md: -------------------------------------------------------------------------------- 1 | id: 1ef8c44f-d412-451f-86d4-fc3d5b8a342f 2 | title: Radio 3 | overview: Radio buttons store their selected `value` as a string. 4 | image: /assets/fieldtypes/radio.png 5 | options: 6 | - 7 | name: options 8 | type: array 9 | description: Sets of key/value pairs that define the values and labels of the radio options. 10 | - 11 | name: inline 12 | type: boolean *false* 13 | description: Setting to true will align the radio buttons inline / horizontally instead of stacking vertically. 14 | -------------------------------------------------------------------------------- /content/collections/modifiers/hours_ago.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: 6ebb6c28-d1f3-4362-92a0-8a16b5c9cd51 5 | parse_content: true 6 | --- 7 | Returns the number of hours since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible. 8 | 9 | ```.language-yaml 10 | date: October 1 2015 11 | ``` 12 | 13 | {{ noparse }} 14 | ``` 15 | {{ date | hours_ago }} 16 | ``` 17 | {{ /noparse }} 18 | 19 | ```.language-output 20 | {{ test_date | hours_ago }} 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/weeks_ago.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: 6fcbfa5c-854e-4541-9955-505eca0d6bf7 5 | parse_content: true 6 | --- 7 | Returns the number of weeks since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible. 8 | 9 | ```.language-yaml 10 | date: October 1 2015 11 | ``` 12 | 13 | {{ noparse }} 14 | ``` 15 | {{ date | weeks_ago }} 16 | ``` 17 | {{ /noparse }} 18 | 19 | ```.language-output 20 | {{ test_date | weeks_ago }} 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/years_ago.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: e73f1574-732e-4a74-be47-37e1fddb05d6 5 | parse_content: true 6 | --- 7 | Returns the number of years since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible. 8 | 9 | ```.language-yaml 10 | date: October 1 2015 11 | ``` 12 | 13 | {{ noparse }} 14 | ``` 15 | {{ date | years_ago }} 16 | ``` 17 | {{ /noparse }} 18 | 19 | ```.language-output 20 | {{ test_date | years_ago }} 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/months_ago.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: 7ba53a64-0266-4752-af5b-282a40dd11fa 5 | parse_content: true 6 | --- 7 | Returns the number of months since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible. 8 | 9 | ```.language-yaml 10 | date: October 1 2017 11 | ``` 12 | 13 | {{ noparse }} 14 | ``` 15 | {{ date | months_ago }} 16 | ``` 17 | {{ /noparse }} 18 | 19 | ```.language-output 20 | {{ test_date | months_ago }} 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/tags/session-flush.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Session:Flush 3 | overview: The session:flush tag is used to clear the entire user session. 4 | id: 1f522665-9fc2-4c9f-9594-04a518c51b39 5 | --- 6 | ## Usage 7 | 8 | Data set in the session will be available in all requests until such time that the session is cleared, either over time (sessions eventually expire) or intentionally. 9 | 10 | The flush tag will wipe the entire session. Keep in mind this will also sign a user out if they're signed in. 11 | 12 | ``` 13 | {{ session:flush }} 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/modifiers/mod.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | id: 10875a6a-9cb8-4e2a-9d39-0d8e4059d815 5 | --- 6 | Get the modulus value (remainder after division) of a value split by another numeric value. Pass an integer or the name of a second variable as the parameter. Also supports `%` as shorthand. 7 | 8 | ```.language-yaml 9 | bottles: 3 10 | glasses: 14 11 | ``` 12 | 13 | ``` 14 | {{ glasses | mod:14 }} 15 | {{ glasses | mod:bottles }} 16 | {{ glasses | %:bottles }} 17 | 18 | ``` 19 | 20 | ```.language-output 21 | 0 22 | 2 23 | 2 24 | ``` 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/read_time.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 6a0abbe0-860a-4e30-b1e7-ecac343149ce 6 | --- 7 | Provide an estimate of the read time in minutes based on a given number of words per minute. Defaults to 200/wpm. 8 | 9 | ```.language-yaml 10 | --- 11 | title: A long post 12 | --- 13 | Pretend there are lots of words here... 14 | ``` 15 | 16 | ``` 17 |

    {{ title }}

    18 |

    {{ content | read_time:180 }} min

    19 | ``` 20 | 21 | ```.language-output 22 |

    A long post

    23 |

    10 min

    24 | ``` 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/seconds_ago.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: 603701ba-5da7-4ec8-abe5-5bc9fe6861ea 5 | parse_content: true 6 | --- 7 | Returns the number of seconds since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible. 8 | 9 | ```.language-yaml 10 | date: October 1 2015 8:30:am 11 | ``` 12 | 13 | {{ noparse }} 14 | ``` 15 | {{ date | seconds_ago }} 16 | ``` 17 | {{ /noparse }} 18 | 19 | ```.language-output 20 | {{ test_date | seconds_ago }} 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/shuffle.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - markup 5 | id: 63acdaa6-9724-4179-b210-ea5d507672e9 6 | --- 7 | Shuffles a string or an array to make it all random. 8 | 9 | ```.language-yaml 10 | string: Mr. Roboto was the original hipster. 11 | array: 12 | - Sonic 13 | - Knuckles 14 | - Tails 15 | ``` 16 | 17 | ``` 18 | {{ string | shuffle }} 19 | {{ array | shuffle }} 20 | ``` 21 | 22 | ```.language-yaml 23 | string: a nhglRsws.oMtiotr hprriao eeo.b ti 24 | array: 25 | - Tails 26 | - Knuckles 27 | - Sonic 28 | ``` 29 | -------------------------------------------------------------------------------- /content/collections/modifiers/subtract.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | id: baad70cf-0af2-48bc-b102-b0da0293baf4 5 | --- 6 | Subtract a value or another variable to your variable. Pass an integer or the name of a second variable as the parameter. Also supports `-` as shorthand. 7 | 8 | ```.language-yaml 9 | capacity: 2500 10 | reservations: 1900 11 | ``` 12 | 13 | ``` 14 | {{ capacity | subtract:1900 }} 15 | {{ capacity | subtract:reservations }} 16 | {{ capacity | -:reservations }} 17 | ``` 18 | 19 | ```.language-output 20 | 600 21 | 600 22 | 600 23 | ``` 24 | -------------------------------------------------------------------------------- /content/collections/tags/session-dump.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Session:Dump 3 | overview: The session:dump tag is used to inspect the user session for debugging purposes. 4 | id: d1ef36ac-7d21-40b2-a7fc-b53a0be3c79c 5 | --- 6 | ## Usage 7 | 8 | You can dump the contents of the user session to aid with development. 9 | ``` 10 | {{ session:dump }} 11 | ``` 12 | 13 | It will be injected into the rendered page in your browser. 14 | 15 |
    16 |

    Preview

    17 | Session Dump 18 |
    19 | -------------------------------------------------------------------------------- /content/collections/classes/api-role.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Role 3 | class: Statamic\API\Role 4 | id: 795ff9b8-7395-4547-ad72-9d4426711da9 5 | --- 6 | ## Get all roles. 7 | 8 | ``` php 9 | Role::all(); // Returns \Illuminate\Support\Collection 10 | ``` 11 | 12 | ## Get a role by ID. 13 | 14 | ``` php 15 | Role::find($id); // Returns Role 16 | ``` 17 | 18 | ## Check if a role exists. 19 | 20 | ``` php 21 | Role::exists($id); // Returns a boolean 22 | ``` 23 | 24 | ## Get a role by handle. 25 | 26 | ``` php 27 | Role::whereHandle($handle); // Returns Role 28 | ``` 29 | -------------------------------------------------------------------------------- /content/collections/events/statamic-updated.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: StatamicUpdated 3 | class: Statamic\Events\StatamicUpdated 4 | id: 5c71e252-9482-4344-87fb-662dba64a5b0 5 | --- 6 | Fired when the Updater has completed, either through the Control Panel or the command line. 7 | 8 | ``` 9 | public $events = [StatamicUpdated::class => 'handle']; 10 | 11 | public function handle(StatamicUpdated $event) 12 | { 13 | $event->version; // The current/new version of Statamic. 14 | $event->previousVersion; // The version Statamic was updated from. 15 | } 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/modifiers/gravatar.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: c0a376c1-1ade-447b-8a2d-18722a5446ba 6 | --- 7 | Converts an email string to a Gravatar image URL. The size can be specified by a parameter. 8 | 9 | ```.language-yaml 10 | email: rswanson@inpra.org 11 | ``` 12 | 13 | ``` 14 | {{ email | gravatar }} 15 | {{ email | gravatar:80 }} 16 | ``` 17 | 18 | ```.language-output 19 | https://www.gravatar.com/avatar/f4650388367dc01cf2acf16b412b3966 20 | https://www.gravatar.com/avatar/f4650388367dc01cf2acf16b412b3966?s=80 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_alpha.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: a6aaac80-19b7-4400-af21-9147aff064c4 6 | --- 7 | Returns `true` if string contains **only** alphabetic characters. Numbers, punctuation, whitespace, and another other special characters will cause a `false`. 8 | 9 | ```.language-yaml 10 | secret_phrase: abcdefg 11 | even_more_secret_phrase: abc123 12 | ``` 13 | 14 | ``` 15 | {{ if secret_phrase | is_alpha }} 16 | {{ if even_more_secret_phrase | is_alpha }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/underscored.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 61a30026-8f98-454e-bcf2-fa7ec1435438 6 | --- 7 | Returns a lowercase and trimmed string separated by underscores. 8 | Underscores are inserted before uppercase characters (with the exception 9 | of the first character of the string), and in place of spaces as well as dashes. 10 | 11 | 12 | ```.language-yaml 13 | string: Please and thank you 14 | ``` 15 | 16 | ``` 17 | {{ string | underscored }} 18 | ``` 19 | 20 | ```.language-output 21 | please_and_thank_you 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/tags/form.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Form 3 | is_parent_tag: true 4 | overview: Create and display submissions grouped into different sections. 5 | id: e4f4f91e-a442-4e15-9e16-3b9880a25522 6 | --- 7 | For information on how to best use these tags, visit the [Trail Guide](/forms). 8 | 9 | There are multiple form tags you may be interested in: 10 | 11 | - [form:create](/tags/form-create) 12 | - [form:errors](/tags/form-errors) 13 | - [form:set](/tags/form-set) 14 | - [form:submission](/tags/form-submission) 15 | - [form:submissions](/tags/form-submissions) 16 | -------------------------------------------------------------------------------- /content/collections/modifiers/camelize.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: fe6dbf39-7870-4aa4-9acb-23b4cbf4bf87 5 | --- 6 | Returns a camelCase version of a string. Trims surrounding spaces, capitalizes letters following digits, spaces, dashes and underscores, and removes spaces, dashes and underscores. It's a programmer-type thing, great for converting between code styles. 7 | 8 | ```.language-yaml 9 | method: make_everything_better 10 | ``` 11 | 12 | ``` 13 | {{ method | camelize }} 14 | ``` 15 | 16 | ```.language-output 17 | makeEverythingBetter 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /content/collections/modifiers/pad.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | id: 0a1595bc-5b41-401c-bb9c-45c35e8e5d7c 5 | --- 6 | Pad an array to a given number of items with a value. By default the value is null, but you can specify it as the second parameter. 7 | 8 | ```.language-yaml 9 | epic_meal_time: 10 | - jack daniels 11 | - bacon strips 12 | ``` 13 | 14 | ``` 15 | {{ epic_meal_time pad="4:bacon strips" }} 16 | {{ value }} 17 | {{ /epic_meal_time }} 18 | ``` 19 | 20 | ```.language-output 21 | jack daniels 22 | bacon strips 23 | bacon strips 24 | bacon strips 25 | ``` 26 | -------------------------------------------------------------------------------- /content/collections/modifiers/textile.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | attributes: true 5 | id: 53a0c177-ce45-43e6-a166-d21f8baeffab 6 | --- 7 | Transform a string with [Textile][textile]. 8 | 9 | ```.language-yaml 10 | quote: You can't wait for inspiration. *You have to go after it with a club.* 11 | 12 | ``` 13 | 14 | ``` 15 | {{ quote | textile }} 16 | ``` 17 | 18 | ```.language-output 19 |

    20 | You can't wait for inspiration. You have to go after it with a club. 21 |

    22 | ``` 23 | 24 | [textile]: http://demo.textilewiki.com/theme-default/ 25 | -------------------------------------------------------------------------------- /content/collections/classes/termfactory.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: TermFactory 3 | class: Statamic\Data\Taxonomies\TermFactory 4 | id: fa4bfc78-cc0d-4bc1-888a-3ae5d6181954 5 | --- 6 | Inheritance: [ContentFactory](/addons/api/contentfactory) 7 | 8 | ## Usage 9 | 10 | Create a `TermFactory` using the API class. You should pass the slug into the `create` method. 11 | 12 | ``` 13 | $factory = Statamic\API\Term::create('my-term'); 14 | ``` 15 | 16 | ## Available Methods 17 | 18 | ### taxonomy 19 | 20 | Specify the taxonomy, as a string. 21 | 22 | ``` 23 | $factory->taxonomy('tags'); 24 | ``` 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_alphanumeric.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - conditions 5 | id: 923f34bd-d17d-4353-821f-48e986bdce3b 6 | --- 7 | Returns `true` if string contains **only** alphanumeric characters. Punctuation, whitespace, and another other special characters will cause a `false`. 8 | 9 | ```.language-yaml 10 | secret_phrase: abc123 11 | even_more_secret_phrase: abc123!@# 12 | ``` 13 | 14 | ``` 15 | {{ if secret_phrase | is_alphanumeric }} 16 | {{ if even_more_secret_phrase | is_alphanumeric }} 17 | ``` 18 | 19 | ```.language-output 20 | true 21 | false 22 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/dump.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | id: 12de1a6c-e8be-4703-81a3-fc270311bc84 5 | --- 6 | Dump a variable to the browser and see under the hood with data types and array exportation. Definitely just for debugging when in development. 7 | 8 | ```.language-yaml 9 | food: 10 | delicious: 11 | - bacon 12 | - sushi 13 | ``` 14 | 15 | ``` 16 | {{ food | dump }} 17 | ``` 18 | 19 | ```.language-output 20 | array:2 [▼ 21 | "delicious" => array:2 [▶] 22 | ] 23 | ``` 24 | 25 | You can also use the [dump tag](/tags/dump) to achieve a similar effect. 26 | -------------------------------------------------------------------------------- /content/collections/modifiers/markdown.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | attributes: true 5 | id: 39dcb2b1-a319-4a0b-b7d0-5c7a1b8aa31b 6 | --- 7 | Transform a string with [Markdown][markdown]. 8 | 9 | ```.language-yaml 10 | quote: You can't wait for inspiration. **You have to go after it with a club.** 11 | 12 | ``` 13 | 14 | ``` 15 | {{ quote | markdown }} 16 | ``` 17 | 18 | ```.language-output 19 |

    20 | You can't wait for inspiration. You have to go after it with a club. 21 |

    22 | ``` 23 | 24 | [markdown]: https://daringfireball.net/projects/markdown/ 25 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_after.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: 3c167645-5ad1-45b4-b6df-22b0d2c95abf 6 | --- 7 | Returns `true` if a date variable is after another date. That second date can be the name of another variable or a literal date string. 8 | 9 | ```.language-yaml 10 | start_date: January 17 2015 11 | end_date: December 1 2015 12 | ``` 13 | 14 | ``` 15 | {{ if end_date | is_after:start_date }} 16 | {{ if start_date | is_after:2014 }} 17 | {{ if start_date | is_after:end_date }} 18 | ``` 19 | 20 | ```.language-output 21 | true 22 | true 23 | false 24 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/minutes_ago.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: 06027289-825e-4205-bd3a-f375e26ab81e 5 | parse_content: true 6 | date: October 1 2015 8:30:am 7 | --- 8 | Returns the number of minutes since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible. 9 | 10 | ```.language-yaml 11 | date: October 1 2015 8:30:am 12 | ``` 13 | 14 | {{ noparse }} 15 | ``` 16 | {{ date | minutes_ago }} 17 | ``` 18 | {{ /noparse }} 19 | 20 | ```.language-output 21 | {{ test_date | minutes_ago }} 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/variables/edit_url.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 4b4bd7a7-6fc8-4457-b030-56d4474e20b0 3 | types: 4 | - content 5 | --- 6 | Get the URL to edit a the current page or entry in the Control Panel, if there is one (for example, there is no `edit_url` for a template route). 7 | 8 | The user will need to login and have permissions, so it's probably best if used in conjunction with [permissions checks](/tags/user-can). 9 | 10 | ``` 11 | Edit this page 12 | ``` 13 | 14 | ``` .language-output 15 | Edit this page 16 | ``` 17 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/toggle.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Toggle 3 | overview: A tactile on/off switch. It's used to create boolean settings. True and false. Nice, simple, and uncomplicated. 4 | image: /assets/fieldtypes/toggle.gif 5 | id: ac5f8f98-616f-4621-a7ee-dbc8bbc15525 6 | --- 7 | ## Data Structure {#data-structure} 8 | 9 | Flicking the toggle to the right sets to the value to `true`, left to `false`. 10 | 11 | ## Templating {#templating} 12 | 13 | Toggle is used for boolean logic, so you can do something like this: 14 | 15 | ``` 16 | {{ if switchy_thing }} Do that thing {{ /if }} 17 | ``` 18 | -------------------------------------------------------------------------------- /content/collections/modifiers/join.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - array 5 | - utility 6 | id: 9dfc5020-3d14-4774-a1f6-d82d051cb964 7 | --- 8 | Turn an array into a string by gluing together all the data with any specified delimiter. It uses a comma by default. 9 | 10 | ```.language-yaml 11 | tasks: 12 | - take a shower 13 | - brush hair 14 | - clip toenails 15 | ``` 16 | 17 | ``` 18 | {{ tasks | join }} 19 | {{ tasks join=" + " }} = ready 20 | ``` 21 | 22 | ```.language-output 23 | take a shower, brush hair, clip toenails 24 | take a shower + brush hair + clip toenails = ready 25 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/title.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 2293d024-32ad-4bb6-a7ff-46ec2e1d9f2f 5 | --- 6 | Returns a trimmed string with the first letter of each word capitalized, ignoring articles, coordinating conjunctions, and short propositions: `a`, `an`, `the`, `at`, `by`, `for`, `in`, `of`, `on`, `to`, `up`, `and`, `as`, `but`, `or`, and `nor`. 7 | 8 | ```.language-yaml 9 | string: It was one of the best adventures of my life 10 | ``` 11 | 12 | ``` 13 | {{ string | title }} 14 | ``` 15 | 16 | ```.language-output 17 | It Was One of the Best Adventures of My Life 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/slugify.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 15ab735c-a877-423a-8e7f-c61e3f68744b 6 | --- 7 | Converts the string into an URL slug. This includes replacing non-ASCII characters with their closest ASCII equivalents, removing remaining non-ASCII 8 | and non-alphanumeric characters, and replacing whitespace with dashes. And then everything is lowercased. 9 | 10 | 11 | ```.language-yaml 12 | string: Please, have some lemoñade. 13 | ``` 14 | 15 | ``` 16 | {{ string | slugify }} 17 | ``` 18 | 19 | ```.language-output 20 | please-have-some-lemonade 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/to_json.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | id: c3214196-3d0d-4a3d-b6c3-1ee4960cfe5d 5 | --- 6 | Converts any variable into JSON. 7 | 8 | ```.language-yaml 9 | stats: 10 | - player: Luke Skywalker 11 | score: 750 12 | - player: Wedge Antilles 13 | score: 688 14 | - player: Jar Jar Binks 15 | score: 1425 16 | ``` 17 | 18 | ``` 19 | {{ stats | to_json }} 20 | ``` 21 | 22 | ```.language-output 23 | [ 24 | {"player":"Luke Skywalker","score":750}, 25 | {"player":"Wedge Antilles","score":688}, 26 | {"player":"Jar Jar Binks","score":1425} 27 | ] 28 | ``` 29 | -------------------------------------------------------------------------------- /content/collections/modifiers/entities.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 50c06e32-9b94-4129-85ba-7cc4201b9e3f 6 | --- 7 | Encode a string with HTML entities via PHP's [htmlentities()][entities] function. This is the opposite of the [decode][decode] modifier. 8 | 9 | ```.language-yaml 10 | string: "The 'bacon' is crispy"; 11 | ``` 12 | 13 | ``` 14 | {{ string | entities }} 15 | ``` 16 | 17 | ```.language-output 18 | The 'bacon' is <b>crispy</b> 19 | ``` 20 | 21 | [entities]: http://php.net/manual/en/function.htmlentities.php 22 | [decode]: /modifiers/decode 23 | -------------------------------------------------------------------------------- /content/collections/modifiers/format_number.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - math 4 | - number 5 | id: 63b56419-6556-4174-8d26-e941460b82a4 6 | --- 7 | Format a number with grouped thousands and decimal points. In other words, make it look nice. 8 | 9 | - Parameter 1: precision (number of decimal places before rounding) 10 | - Parameter 2: Decimal point (default `.`) 11 | - Parameter 3: Thousands separator (default: `,`) 12 | 13 | ```.language-yaml 14 | lucky_number: 130134.109 15 | ``` 16 | 17 | ``` 18 | {{ lucky_number format_number="1|,|," }} 19 | ``` 20 | 21 | ```.language-output 22 | 130,134,1 23 | ``` 24 | -------------------------------------------------------------------------------- /content/collections/modifiers/sum.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - math 5 | id: ee2da74a-0788-400f-804f-c85ad9b635c0 6 | --- 7 | Returns the sum of all items in an array, optionally specified by a specific key. 8 | 9 | ```.language-yaml 10 | numbers: 11 | - 5 12 | - 10 13 | - 20 14 | - 40 15 | stats: 16 | - player: Luke Skywalker 17 | score: 750 18 | - player: Wedge Antilles 19 | score: 688 20 | - player: Jar Jar Binks 21 | score: 1425 22 | ``` 23 | 24 | ``` 25 | {{ numbers | sum }} 26 | {{ stats | sum:score }} 27 | ``` 28 | 29 | ```.language-output 30 | 75 31 | 2863 32 | ``` 33 | -------------------------------------------------------------------------------- /content/collections/modifiers/group_by.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | id: a070fabe-c413-4b31-9cb4-ad14bbe1aa4d 5 | --- 6 | Group an array's items by a given key. 7 | 8 | ```.language-yaml 9 | sponsors: 10 | - 11 | sport: basketball 12 | team: Jazz 13 | - 14 | sport: baseball 15 | team: Yankees 16 | - 17 | sport: basketball 18 | team: Bulls 19 | ``` 20 | 21 | ``` 22 | {{ sponsors group_by="sport" }} 23 | {{ basketball }} 24 |

    {{ team }}

    25 | {{ /basketball 26 | {{ /sponsors }} 27 | ``` 28 | 29 | ```.language-output 30 |

    Jazz

    31 |

    Bulls

    32 | ``` 33 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_empty.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | id: a94a24ce-500d-4194-85db-85fcbb552e06 5 | --- 6 | Checks to see if an array is empty without any set values. Works with numeric indexes, associative, and string keyed arrays of all depths. It's pretty smart, as these things go. 7 | 8 | ```.language-yaml 9 | some_data: 10 | - is living here 11 | more_data: 12 | with: 13 | hopes: 14 | and: 15 | dreams: 16 | - 17 | ``` 18 | 19 | ``` 20 | {{ if some_data | is_empty }} 21 | {{ if more_data | is_empty }} 22 | 23 | ``` 24 | 25 | ```.language-output 26 | false 27 | true 28 | ``` 29 | -------------------------------------------------------------------------------- /content/collections/modifiers/obfuscate.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | - utility 5 | attributes: true 6 | id: 84aca464-65b1-4cc9-8bc9-e64b33797579 7 | --- 8 | Obfuscates a string with special characters making it hard for spam bots to sniff out and scrape off your site. Still appears like the same string to the reader. This is usually used for email addresses. 9 | 10 | ```.language-yaml 11 | magic_word: Abracadabra 12 | ``` 13 | 14 | ``` 15 | {{ magic_word | obfuscate }} 16 | ``` 17 | 18 | ```.language-output 19 | # visibly appears as Abracadabra 20 | Abracadabra 21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/spaceless.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | added_in: 2.8.4 6 | id: 3bcdbffa-8020-4364-8c2a-1fe1a9ff0a5c 7 | --- 8 | Removes excess whitespace and line breaks from a string. A definite OCD pleaser. 9 | 10 | ``` 11 | html: | 12 |

    I copy & pasted 13 | this link 14 | for you!

    15 | ``` 16 | 17 | ``` 18 | {{ html | spaceless }} 19 | ``` 20 | 21 | ```.language-output 22 |

    I copy & pasted this link for you!

    23 | ``` 24 | -------------------------------------------------------------------------------- /content/collections/modifiers/dl.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - markup 5 | id: fbdb7bf5-ac19-444c-9536-57332ffff388 6 | --- 7 | Turn a key/value array, otherwise known as a YAML mapping, into an HTML definition list. 8 | 9 | ```.language-yaml 10 | food: 11 | Delicious: 12 | - bacon 13 | - sushi 14 | Green: 15 | - broccoli 16 | - kale 17 | ``` 18 | 19 | ``` 20 | {{ food | dl }} 21 | ``` 22 | 23 | ```.language-output 24 |
    25 |
    Delicious
    26 |
    bacon
    27 |
    sushi
    28 | 29 |
    Green
    30 |
    broccoli
    31 |
    kale
    32 |
    33 | ``` 34 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_before.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - conditions 5 | id: 85b0a5d9-eb77-4bc2-b60e-7b4d3f9aa406 6 | --- 7 | Returns `true` if a date variable is before another date. That second date can be the name of another variable or a literal date string. 8 | 9 | ```.language-yaml 10 | start_date: January 17 2015 11 | end_date: December 1 2015 12 | ``` 13 | 14 | ``` 15 | {{ if end_date | is_before:start_date }} 16 | {{ if start_date | is_before:2014 }} 17 | {{ if start_date | is_before:end_date }} 18 | ``` 19 | 20 | ```.language-output 21 | false 22 | false 23 | true 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /content/collections/tags/pages-previous.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Previous 3 | overview: Grab the previous Pages relative to your current Page. 4 | id: 1172608e-0e75-487a-8cd6-872746542550 5 | --- 6 | This Tag functions the same way as the [`pages:next`](/tags/pages-next) tag, but in the opposite direction. 7 | 8 | ``` 9 | {{ pages:previous as="stories" limit="2" }} 10 | 11 | {{ if no_results }} 12 | No more stories to read! 13 | {{ /if }} 14 | 15 | {{ stories }} 16 |
    17 | {{ title }} 18 |
    19 | {{ /stories }} 20 | 21 | {{ /pages:previous }} 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/modifiers/format.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - string 5 | id: 756d23b4-209c-457c-b9f5-d69347bbe8fe 6 | --- 7 | Given a date string, or anything that sort of looks like a date string, `format` will convert it to a [Carbon][carbon] instance and allow you to format it with PHP's [datetime format][datetime] variables. 8 | 9 | ```.language-yaml 10 | event_date: April 15 2016 11 | ``` 12 | 13 | ``` 14 | {{ event_date format="Y-m-d" }} 15 | ``` 16 | 17 | ```.language-output 18 | 2016-04-15 19 | ``` 20 | 21 | [carbon]: http://carbon.nesbot.com 22 | [datetime]: http://php.net/manual/en/function.date.php 23 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Statamic Docs 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: 4 | 5 | ## Issues vs Pull Requests 6 | 7 | Please send a **Pull Request** for any and all content changes. 8 | 9 | If you're unclear about the documentation and need some clarification, or if there are visual/layout/style problems, an **Issue** is appropriate. 10 | 11 | ## Grammar and Writing Style 12 | 13 | 1. Respect the Oxford Coma. 14 | 2. See number one. 15 | 16 | ![Oxford Comma](http://images.fineartamerica.com/images/artworkimages/mediumlarge/1/the-oxford-comma-eric-edelman.jpg) 17 | -------------------------------------------------------------------------------- /content/collections/kb/yaml-error.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "YAML Error" 3 | kb_categories: 4 | - Troubleshooting Common Scenarios 5 | id: 7300a8ee-0d0e-491c-bb39-b1ebf26eaf58 6 | --- 7 | If you're getting a `Array to string` error when saving/creating content: 8 | ``` 9 | ErrorException: Array to string conversion in /home/site/statamic/core/API/YAML.php:68 10 | ``` 11 | 12 | Check to see if you have any `content` fields that aren't just strings, like `Grid`, `Replicator`, `Bard`. 13 | 14 | `content` is a reserved word and Statamic assumes it only has textual data, so you'll have to rename your existing field(s) to something else. 15 | -------------------------------------------------------------------------------- /content/collections/modifiers/obfuscate_email.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | attributes: true 5 | id: 536ac4b3-bfc7-4ced-8c83-d389fb94a262 6 | --- 7 | Obfuscates an email address with special characters making it hard for spam bots to sniff out and scrape off your site. Still reads like an email address as far as readers are concerned. 8 | 9 | ```.language-yaml 10 | holler: holler@example.com 11 | ``` 12 | 13 | ``` 14 | {{ holler | obfuscate_email }} 15 | ``` 16 | 17 | ```.language-output 18 | # output appears as holler@example.com 19 | holler@example.com 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/yaml.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: YAML 3 | overview: > 4 | A code editor set to YAML mode to help you write and store raw data as, you guessed it, YAML. Want to [learn more about YAML?](/yaml) Want us to say YAML again? 5 | image: /assets/fieldtypes/yaml.jpg 6 | options: 7 | - 8 | name: rows 9 | type: integer 10 | description: > 11 | The number of rows of text to display. 12 | Controls the initial height of the 13 | field. 14 | id: 25155800-8fd7-46c7-aad0-5daaf07543da 15 | --- 16 | This field is essentially a [Textarea fieldtype](/fieldtypes/textarea) that gets saved as YAML instead of a string. 17 | -------------------------------------------------------------------------------- /content/collections/tags/search-form.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Form 3 | description: How to create a search form. 4 | id: 1ab4aca4-1add-4b41-b40c-4f3e8170fd98 5 | --- 6 | There's no special search form tag that you need to use. Simply create a form that performs a GET request to where your results will be listed. 7 | 8 | ``` 9 |
    10 | 11 | 12 |
    13 | ``` 14 | 15 | Assuming that the `{{ search:results }}` tag is on `/search-results`, and that you searched for `majestic stags`, submitting this form will take you to `/search-results?q=majestic+stags`. 16 | -------------------------------------------------------------------------------- /content/collections/classes/api-taxonomy.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taxonomy 3 | class: Statamic\API\Taxonomy 4 | id: b109a335-e262-4313-9f9a-1507ba31a22c 5 | --- 6 | ## Get all taxonomies. 7 | 8 | ``` php 9 | Taxonomy::all(); // Returns \Illuminate\Support\Collection 10 | ``` 11 | 12 | ## Get the handles of all taxonomies. 13 | 14 | ``` php 15 | Taxonomy::handles(); // Returns an array of strings 16 | ``` 17 | 18 | ## Get a taxonomy by handle. 19 | 20 | ``` php 21 | Taxonomy::whereHandle($handle); // Returns TaxonomyFolder 22 | ``` 23 | 24 | ## Check if a taxonomy exists. 25 | 26 | ``` php 27 | Taxonomy::handleExists($handle); // Returns a boolean 28 | ``` 29 | -------------------------------------------------------------------------------- /content/collections/tags/redirect.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Redirect 3 | overview: Redirect to another page. 4 | parameters: 5 | - 6 | name: url 7 | type: string 8 | description: Destination URL 9 | - 10 | name: to 11 | type: string 12 | description: Alias of `url` 13 | - 14 | name: response 15 | type: 'integer *302*' 16 | description: The HTTP response code to use. 17 | id: 444d1109-ed96-4162-b86d-24b39f569220 18 | --- 19 | ## Example {#example} 20 | 21 | ``` 22 | {{ if !open }} 23 | {{ redirect to="/" }} 24 | {{ /if }} 25 | ``` 26 | 27 | If the `open` tag is not true, this will forward the visitors to the homepage. 28 | -------------------------------------------------------------------------------- /content/collections/events/page-moved.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PageMoved 3 | class: Statamic\Events\Data\PageMoved 4 | id: 48e9334d-be29-4980-b421-cda4b91b25a5 5 | --- 6 | This is a [data event](/addons/events/#data-events) that is dispatched when a page is moved. 7 | 8 | Typically, this happens when reordering through the control panel. This event is dispatched once for every page that was affected 9 | when reordering through the control panel. There is a [PagesMoved event](/addons/events/pages-moved) that will be dispatched 10 | once for the entire operation that contains all affected pages. 11 | 12 | ``` 13 | public function handle(PageMoved $event); 14 | ``` 15 | -------------------------------------------------------------------------------- /content/collections/events/response-created.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: response.created 3 | class: response.created 4 | id: 0bd05051-f84c-4422-b26d-98f5c7a92605 5 | --- 6 | Fired just after the response has been created for front-end requests, and just before it gets sent. 7 | 8 | This is a perfect time for you to modify the response by adding headers, adjusting the output, etc. 9 | 10 | An `Illuminate\Http\Response` instance will be passed through. Simply modify it and don't return anything. 11 | 12 | ``` 13 | use Illuminate\Http\Response; 14 | 15 | public $events = ['response.created' => 'handle']; 16 | 17 | public function handle(Response $response); 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/modifiers/decode.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | id: 1fd780fd-ae92-4e73-9513-2b9c845976e9 5 | --- 6 | Convert all HTML entities to their applicable characters via PHP's [html_entity_decode()][decode] function. Will convert both double and single quotes. This is the opposite of the [entities][entities] modifier. 7 | 8 | ```.language-yaml 9 | string: "I'll \"eat\" the bacon now"; 10 | ``` 11 | 12 | ``` 13 | {{ string | decode }} 14 | ``` 15 | 16 | ```.language-output 17 | I'll "eat" the bacon now 18 | ``` 19 | 20 | [decode]: http://php.net/manual/en/function.html-entity-decode.php 21 | [entities]: /modifiers/entities 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/where.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - condition 4 | - array 5 | id: c36a6f62-aaf4-478b-a469-29cdb1eab8dc 6 | --- 7 | Filter an array (such as a Replicator field's data) to items where a `key` has a specific `value`. 8 | 9 | ```.language-yaml 10 | games: 11 | - 12 | feeling: love 13 | title: Dominion 14 | - 15 | feeling: love 16 | title: Netrunner 17 | - 18 | feeling: hate 19 | title: Chutes and Ladders 20 | ``` 21 | 22 | ``` 23 |

    I love...

    24 | {{ games where="feeling:love" }} 25 | {{ title }}
    26 | {{ /games }} 27 | ``` 28 | 29 | ```.language-output 30 | Dominion 31 | Netrunner 32 | ``` 33 | -------------------------------------------------------------------------------- /content/collections/modifiers/get.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Get 3 | types: 4 | - asset 5 | - utility 6 | - relationship 7 | id: c6311d04-364d-4086-8b6b-2a58e88c6cb8 8 | --- 9 | Gets a value from a relationship based on its ID. This is like a nicer-to-read single tag version of the 10 | [Relate Tag](/tags/relate). 11 | 12 | ``` .language-yaml 13 | featured_post: 4e82a520-275f-11e6-bdf4-0800200c9a66 14 | ``` 15 | 16 | ``` 17 | {{ featured_post | get:title }} 18 | ``` 19 | 20 | ``` .language-output 21 | Featured Post Title 22 | ``` 23 | 24 | The above is equivalent to doing this: 25 | 26 | ``` 27 | {{ relate:featured_post }}{{ title }}{{ /relate:featured_post }} 28 | ``` 29 | -------------------------------------------------------------------------------- /content/collections/modifiers/yes_no.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | - conditions 6 | id: 3773fc46-e5f2-4a87-8f68-4ac906bca50d 7 | --- 8 | A ternary-esque syntax for outputting `yes` if true, `no` if false. Both values can be customized by passing additional parameters. Also supports `?` as shorthand. 9 | 10 | ```.language-yaml 11 | foo: true 12 | bar: false 13 | ``` 14 | 15 | ``` 16 | {{ foo | yes_no }} 17 | {{ bar | yes_no }} 18 | {{ foo | yes_no:yep:nah }} 19 | {{ bar | yes_no:yep:nah }} 20 | {{ foo | ?:yep:nah }} 21 | {{ bar | ?:yep:nah }} 22 | ``` 23 | 24 | ```.language-output 25 | yes 26 | no 27 | yep 28 | nah 29 | yep 30 | nah 31 | ``` 32 | -------------------------------------------------------------------------------- /content/collections/tags/collection-previous.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Previous 3 | overview: Grab the previous entries relative to current entry in a Collection. 4 | id: 741cf972-c0bd-4e3c-81e2-8cc8bea60737 5 | --- 6 | This Tag functions the same way as the [`collection:next`](/tags/collection-next) tag, but in the opposite direction. 7 | 8 | ``` 9 | {{ collection:previous in="blog" as="posts" limit="2" sort="date:asc" }} 10 | 11 | {{ if no_results }} 12 | No more posts to read! 13 | {{ /if }} 14 | 15 | {{ posts }} 16 |
    17 | {{ title }} 18 |
    19 | {{ /posts }} 20 | 21 | {{ /collection:previous }} 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/events/cp-published.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: cp.published 3 | class: cp.published 4 | id: 2a170192-f4b2-4f63-8ccd-45fd2c423002 5 | --- 6 | Fired when any Page, Entry, Taxonomy Term, Global, or User is saved **through the Control Panel**. The respective class will be passed through. 7 | 8 | ``` 9 | public $events = ['cp.published' => 'handle']; 10 | 11 | public function handle(Data $data); 12 | ``` 13 | 14 | If you require listening for more a more specific version, an event for the respective type will also be dispatched: 15 | 16 | - `cp.page.published` 17 | - `cp.entry.published` 18 | - `cp.term.published` 19 | - `cp.globals.published` 20 | - `cp.user.published` 21 | -------------------------------------------------------------------------------- /content/collections/events/finding-fieldset.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: FindingFieldset 3 | class: Statamic\Events\Data\FindingFieldset 4 | id: 386f3e48-85f9-45d3-b8a0-ac586b5879ab 5 | --- 6 | This is dispatched when Statamic attemps to find a fieldset for a specific content object. 7 | 8 | ``` 9 | public function handle(FindingFieldset $event) 10 | { 11 | $event->data; // The content object. The Page, Entry, etc 12 | $event->fieldset; // The fieldset. 13 | } 14 | ``` 15 | 16 | You may modify the fieldset here and it will be reflected in whatever was requesting it. 17 | 18 | An example of when this would be useful is to add a section to a fieldset in the publish page on the fly. 19 | -------------------------------------------------------------------------------- /content/pages/3.modifiers/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Modifiers 3 | mount: modifiers 4 | id: 199357e4-3eea-4939-9757-0e3f6f88083b 5 | template: modifiers 6 | overview: Modifiers give you the ability to manipulate the data of your variables on the fly. They can manipulate strings, filter arrays and lists, help you compare things, do basic math, simplify your markup, and even help you debug. 7 | video: https://www.youtube.com/watch?v=V27N3Jh4APs 8 | --- 9 | We've organized the modifiers by type of data they're designed to manipulate or the type of function they perform. Some modifiers (like `shuffle` and `count`) work on multiple data types and will be repeated in more than one section. 10 | -------------------------------------------------------------------------------- /content/collections/modifiers/flatten.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: e893345c-03f7-466b-a400-bbd2545bd780 6 | --- 7 | Flattens a multi-dimensional array (a Grid or Replicator field for example) into a single dimension. 8 | 9 | ```.language-yaml 10 | ingredients: 11 | spices: [garlic, cumin, ginger, turmeric, paprika, curry powder] 12 | vegetables: [tomatoes, onion] 13 | meat: [chicken] 14 | ``` 15 | 16 | ``` 17 | {{ ingredients | flatten }} 18 | ``` 19 | 20 | ```.language-yaml 21 | ingredients: 22 | - garlic 23 | - cumin 24 | - ginger 25 | - turmeric 26 | - paprika 27 | - curry powder 28 | - tomatoes 29 | - onion 30 | - chicken 31 | ``` -------------------------------------------------------------------------------- /content/collections/variables/focus.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - asset 4 | id: d61d8f8c-4e7e-4933-8f34-0cdba2a3ee82 5 | --- 6 | The focal point of the asset, defaulting to center (`50-50`). 7 | 8 | ``` 9 | {{ focus }} 10 | ``` 11 | 12 | ``` .language-output 13 | 50-30 14 | ``` 15 | 16 | You may want to use this in CSS with either the [background_position](/modifiers/background_position) modifier, or just by using the [focus_css](/variables/focus_css) variable. 17 | 18 | ``` 19 | background-position: {{ focus | background_position }}; 20 | background-position: {{ focus_css }}; 21 | ``` 22 | 23 | ``` .language-output 24 | background-position: 50% 30%; 25 | background-position: 50% 30%; 26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/modifiers/is_embeddable.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: d3ab4cb6-2aeb-4a15-93b9-79e56ad82223 5 | --- 6 | Checks to see if a video URL is embeddable. ie. If it is a YouTube or Vimeo URL. 7 | 8 | Plays nicely with the [Video fieldtype](/fieldtypes/video) and the [embed_url modifier](/modifiers/embed_url). 9 | 10 | ``` .language-yaml 11 | youtube: https://www.youtube.com/watch?v=s9F5fhJQo34 12 | vimeo: https://vimeo.com/22439234 13 | other: http://example.com/video.mp4 14 | ``` 15 | 16 | ``` 17 | {{ youtube | is_embeddable }} 18 | {{ vimeo | is_embeddable }} 19 | {{ other | is_embeddable }} 20 | ``` 21 | 22 | ``` .language-output 23 | true 24 | true 25 | false 26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/tags/section.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Section 3 | overview: 'Extract a section of template that can be retrieved in a [Yield Tag](/tags/yield).' 4 | id: 21481d1a-ee1b-4acd-b5ad-65dc7fcec976 5 | --- 6 | 7 | ## Example {#example} 8 | 9 | Here's an example template: 10 | 11 | ``` 12 |

    {{ title }}

    13 |
    14 | {{ content }} 15 |
    16 | 17 | {{ section:sidebar }} 18 | Some sidebar stuff! 19 | {{ /section:sidebar }} 20 | ``` 21 | 22 | Everything within the `section:sidebar` tag pair will _not_ be rendered in this template. It will be rendered 23 | in your layout (or partials within a layout) in the `{{ yield:sidebar }}` tag. 24 | 25 | [yield_tag]: /tags/yield 26 | -------------------------------------------------------------------------------- /content/collections/modifiers/count_substring.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 84c6f375-10ca-4296-89a8-a22b9652b5d5 5 | --- 6 | Returns the number of occurrences of search term in a given string. By default, 7 | the comparison is case-insensitive, but can be made sensitive by setting the second parameter to `true`. 8 | 9 | ```.language-yaml 10 | quote: | 11 | Dude! You got a tattoo! 12 | So do you, dude! Dude, what does my tattoo say? 13 | Sweet! What about mine? 14 | Dude! What does mine say? 15 | Sweet! What about mine? 16 | Dude! What does mine say? 17 | ``` 18 | 19 | ``` 20 | {{ quote count_substring="dude" }} 21 | ``` 22 | 23 | ```.language-output 24 | 5 25 | ``` 26 | 27 | 28 | -------------------------------------------------------------------------------- /content/collections/tags/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Env 3 | overview: Output environment variable values. 4 | parameters: 5 | - 6 | name: default|fallback 7 | type: string 8 | description: "In the event that the requested variable doesn't exist, this will be used a fallback." 9 | id: 967d4bad-34a0-4a6a-8af1-6e88c6b900ed 10 | --- 11 | ## Example 12 | 13 | This tag is a nice simple way to output values from your environment variables. 14 | 15 | In your environment file (`.env`): 16 | 17 | ``` 18 | FOO=bar 19 | ``` 20 | 21 | ``` 22 | 1. {{ env:FOO }} 23 | 2. {{ env:HELLO }} 24 | 3. {{ env:HELLO default="world" }} 25 | ``` 26 | 27 | ``` .language-output 28 | 1. bar 29 | 2. 30 | 3. world 31 | ``` 32 | -------------------------------------------------------------------------------- /content/collections/fieldtypes/fieldset.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Fieldset 3 | id: 7db4b1f2-5840-46b0-b9db-fdfcafd91269 4 | overview: | 5 | A select field pre-filled with your site's fieldsets. Pretty simple! 6 | image: /assets/fieldtypes/fieldset.png 7 | options: 8 | - 9 | name: hidden 10 | type: boolean *false* 11 | description: Show hidden fieldsets. 12 | --- 13 | It'll let you create them on the fly, too. Click the + button and type away. A barebones fieldset will be created 14 | that you can use immediately. Then simply go and edit the fieldset later. 15 | 16 | If you've created a fieldset in another tab while you've had this page open, you can click the refresh button to see 17 | any additions. 18 | -------------------------------------------------------------------------------- /content/collections/modifiers/merge.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | id: d15bda69-36ee-4871-82b2-e66447868643 5 | --- 6 | 7 | Merge an array variable with another array variable. 8 | 9 | ```.language-yaml 10 | fruit: 11 | - apples 12 | - bananas 13 | - bacon 14 | meat: 15 | - pork 16 | - beef 17 | - chicken 18 | ``` 19 | 20 | ``` 21 | {{ fruit }} 22 | ``` 23 | 24 | ```.language-output 25 | apples bannanas bacon 26 | ``` 27 | 28 | ``` 29 | {{ meat }} 30 | ``` 31 | 32 | ```.language-output 33 | pork beef chicken 34 | ``` 35 | 36 | ``` 37 | {{ fruit merge="meat" }} 38 | {{ value }} 39 | {{ /fruit }} 40 | ``` 41 | 42 | ```.langauge-output 43 | apples bananas bacon pork beef chicken 44 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/widont.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: cbb290f3-ffd0-4dc1-8989-1d10a92ff17d 6 | --- 7 | Attempts to prevent widows (a line with a single word) in a string by adding non-breaking spaces between the last two words of each paragraph. 8 | 9 | The first parameter allows you to customize the number of words to add non-breaking spaces to. 10 | 11 | ```.language-yaml 12 | string: I Just Want Pretty Headlines and Sentences 13 | ``` 14 | 15 | ``` 16 | {{ string | widont }} 17 | {{ string | widont:4 }} 18 | ``` 19 | 20 | ```.language-output 21 | I Just Want Pretty Headlines and Sentences 22 | I Just Want Pretty Headlines and Sentences 23 | ``` 24 | -------------------------------------------------------------------------------- /content/collections/modifiers/wrap.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - markup 4 | - string 5 | id: ee9e1c05-8b5d-47f9-b476-3d108a9c14af 6 | --- 7 | Wraps a string with a given HTML tag. Has the nice benefit of returning null if there is no data, eliminating the need for simple `{{ if }}` wrappers. 8 | 9 | ```.language-yaml 10 | title: As the World Turns 11 | ``` 12 | 13 | ``` 14 | {{ title | wrap:h1 }} 15 | ``` 16 | 17 | ```.language-output 18 |

    As the World Turns

    19 | ``` 20 | 21 | You may also use Emmet-style CSS classes to be added to the tag. 22 | 23 | ``` 24 | {{ title | wrap:h1.fast.furious }} 25 | ``` 26 | 27 | ``` .language-output 28 |

    As the World Turns

    29 | ``` 30 | -------------------------------------------------------------------------------- /content/collections/modifiers/full_urls.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | - utility 5 | id: 44cb7965-877e-49b3-92fe-a24970b542a2 6 | --- 7 | Replaces root-relative URLs with absolute URLs. This is generally used in RSS feeds and other places where markup may be used off the main site. 8 | 9 | ```.language-markdown 10 | --- 11 | I had this totally [crazy dream](/dream-journal/spiders-with-ramen-legs) 12 | last night and I know you want to hear all about it! 13 | ``` 14 | 15 | ``` 16 | {{ content | full_urls }} 17 | ``` 18 | 19 | ```.language-output 20 | I had this totally [crazy dream](http://example.com/dream-journal/spiders-with-ramen-legs) 21 | last night and I know you want to hear all about it! 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/tags/markdown-indent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Indent 3 | id: d26ec250-460e-11e7-9598-0800200c9a66 4 | overview: Convert content between the tags into markdown, ignoring indentation. 5 | --- 6 | Similar to the [`{{ markdown }}`](/tags/markdown) tag, `{{ markdown:indent }}` is a tag-pair version of the [markdown modifier](/modifiers/markdown). However, it additionally ignores indentation so everything isn't simply rendered in a `` block. 7 | 8 | ## Example {#example} 9 | 10 | ``` 11 | {{ markdown:indent }} 12 | ## Ode To Bacon 13 | 14 | Bacon. Mmm, bacon. 15 | {{ /markdown:indent }} 16 | ``` 17 | 18 | ``` .language-output 19 |

    Ode To Bacon

    20 |

    Bacon. Mmm, bacon.

    21 | ``` 22 | -------------------------------------------------------------------------------- /content/collections/events/stache-updated.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: StacheUpdated 3 | class: Statamic\Events\StacheUpdated 4 | id: cfe23989-068f-46e6-9616-7a8b20697a80 5 | --- 6 | Fired when the Stache is updated (ie. when content, assets, or users are created/modified) this will be fired. 7 | 8 | ``` 9 | public $events = [StacheUpdated::class => 'handle']; 10 | 11 | public function handle(StacheUpdated $event) 12 | { 13 | $event->stache; // Statamic\Contracts\Stache\Cache 14 | $event->updates; // \Illuminate\Support\Collection of repos that were updated 15 | $event->updated($repo); // Check if a given repo was updated 16 | $event->updatedAny($repos); // Check if any given repos were updated 17 | } 18 | ``` 19 | -------------------------------------------------------------------------------- /content/collections/tags/session-forget.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Session:Forget 3 | overview: The session:forget tag is used to remove data from the user session. 4 | id: be024503-9796-4f2f-9c75-548e2ea09cec 5 | --- 6 | ## Usage 7 | 8 | Data set in the session will be available in all requests until such time that the session is cleared, either over time (sessions eventually expire) or intentionally. 9 | 10 | Remove variables from the session by passing a collection of keys into the tag. 11 | ``` 12 | {{ session:forget keys="likes|referral" }} 13 | ``` 14 | 15 | Or you can wipe the entire session with the flush tag. Keep in mind this will also sign a user out if they're signed in. 16 | 17 | ``` 18 | {{ session:flush }} 19 | ``` 20 | -------------------------------------------------------------------------------- /content/collections/tags/session-flash.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Session:Flash 3 | overview: The session:flash tag is used to store data for a single request. 4 | id: 29957a36-a15a-4fd0-9342-b829b6235fea 5 | --- 6 | ## Usage 7 | 8 | Flash data is only kept for a single request. It is generally used for success/failure messages that remove themselves automatically. 9 | 10 | Setting and retrieving flash data works in exactly the same fashion as regular session data. 11 | ``` 12 | {{ session:flash success="true" message="You did it!" }} 13 | ``` 14 | 15 | The next (and only next) request will then have those variables available for you. 16 | 17 | ``` 18 | {{ session:success }} ~> true 19 | {{ session:message }} ~> You did it! 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/modifiers/partial.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - utility 4 | - string 5 | - array 6 | id: 23d51738-5043-49e3-8ca3-d5848427216f 7 | --- 8 | Inject a variable's data into a partial and render it without any page scopes whatsoever. This is really just syntactical sugar, but it _is_ delicious. 9 | 10 | ```.language-yaml 11 | data: 12 | title: Bubble Guppies 13 | content: Science died a little bit today. 14 | ``` 15 | 16 | ``` 17 | 18 |

    {{ title }}

    19 | {{ content | markdown }} 20 | 21 | 22 | {{ data | partial:demo }} 23 | ``` 24 | 25 | ```.language-output 26 |

    Bubble Guppies

    27 |

    Science died a little bit today.

    28 | ``` 29 | -------------------------------------------------------------------------------- /content/collections/kb/forge.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Deploying Statamic sites with Laravel Forge 3 | id: 351f546c-fcf1-4443-8947-8ac3d297d4cb 4 | kb_categories: 5 | - Tips, Tricks, and How-Tos 6 | --- 7 | [Laravel Forge](https://forge.laravel.com) is an awesome tool/service that can spin up cloud servers and manage all your deployments with Git. We highly recommend it. Watch how easy it is: 8 | 9 | 10 |

    Deployments with Forge from Statamic on Vimeo.

    11 | -------------------------------------------------------------------------------- /content/collections/tags/user-logout.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Logout 3 | overview: Log a user out immediately and redirect them elsewhere. 4 | parameters: 5 | - 6 | name: redirect 7 | type: string 8 | description: > 9 | Where the user should be redirected 10 | after logging out. Defaults to the home 11 | page. 12 | id: 3604bfe9-89be-42af-8163-4b378279026a 13 | --- 14 | 15 | ## Example {#example} 16 | 17 | ``` 18 | {{ if should_logout_for_whatever_reason }} 19 | {{ user:logout redirect="/somewhere" }} 20 | {{ /if }} 21 | ``` 22 | 23 | This will immediately log a user out and redirect to `/somewhere` if the condition is met. 24 | 25 | If you'd like to just output a link, use the [`user:logout_url`](/tags/user-logout_url) tag. 26 | -------------------------------------------------------------------------------- /content/collections/modifiers/embed_url.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 45310885-fbd3-438d-85d5-076dda1646e0 5 | --- 6 | Converts a Youtube or Vimeo link to their embed URLs. 7 | 8 | Plays nicely with the [Video fieldtype](/fieldtypes/video) and the [is_embeddable modifier](/modifiers/is_embeddable). 9 | 10 | ``` .language-yaml 11 | youtube: https://www.youtube.com/watch?v=s9F5fhJQo34 12 | vimeo: https://vimeo.com/22439234 13 | other: http://example.com/video.mp4 14 | ``` 15 | 16 | ``` 17 | {{ youtube | embed_url }} 18 | {{ vimeo | embed_url }} 19 | {{ other | embed_url }} 20 | ``` 21 | 22 | ``` .language-output 23 | https://www.youtube.com/embed/s9F5fhJQo34 24 | https://player.vimeo.com/video/22439234 25 | http://example.com/video.mp4 26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/modifiers/flip.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | id: f874e969-d579-4501-9140-e4005945d302 5 | --- 6 | Swaps the keys with their corresponding values. The old switcharoo. 7 | 8 | ```.language-yaml 9 | favorites: 10 | chicken: nuggets 11 | nuggets: Denver 12 | ``` 13 | 14 | ``` 15 | {{ favorites }} 16 | My favorite {{ key }} is {{ value }}. 17 | {{ /favoites }} 18 | 19 | {{ favorites | flip }} 20 | My favorite {{ key }} is {{ value }}. 21 | {{ /favoites }} 22 | ``` 23 | 24 | ```.language-output 25 | My favorite chicken is nuggets. 26 | My favorite nuggets is Denver 27 | 28 | My favorite nuggets is chicken 29 | My favorite Denver is nuggets. 30 | ``` 31 | 32 | It's a weird example with bad grammer. Hopefully you're okay with it. -------------------------------------------------------------------------------- /content/collections/modifiers/format_localized.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | - string 5 | id: 1d181ecf-69ad-4dbe-ae78-bb3b21547a8d 6 | --- 7 | Given a date string, or anything that sort of looks like a date string, `format` will convert it to a [Carbon][carbon] instance and allow you to format it with PHP's [strftime format][strftime] variables. It will use the current locale defined in your system settings. 8 | 9 | ```.language-yaml 10 | event_date: April 15 2016 11 | ``` 12 | 13 | ``` 14 | {{ event_date format_localized="%A %d %B %Y" }} 15 | ``` 16 | 17 | Assuming your locale is `fr_FR`: 18 | 19 | ```.language-output 20 | Vendredi 15 avril 2016 21 | ``` 22 | 23 | 24 | [carbon]: http://carbon.nesbot.com 25 | [strftime]: http://php.net/strftime 26 | -------------------------------------------------------------------------------- /content/collections/tags/widont.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Widont 3 | parse_content: false 4 | overview: > 5 | Attempts to prevent widows (a line with a single word) in a string by adding non-breaking spaces 6 | between the last two words of each paragraph. 7 | description: Prevent widows in your content. 8 | id: c56974d4-70cf-45da-82d9-e25c1f4078a8 9 | parameters: 10 | - 11 | name: words 12 | type: 'integer *2*' 13 | description: > 14 | The number of words to add non-breaking spaces to at the end of the string. 15 | --- 16 | ## Usage {#usage} 17 | 18 | ``` 19 | {{ widont }} 20 | I Just Want Pretty Headlines and Sentences 21 | {{ /widont }} 22 | ``` 23 | 24 | ```.language-output 25 | I Just Want Pretty Headlines and Sentences 26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/modifiers/limit.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: a3c9e1c5-10ec-44da-b8d8-fdc603fce5a3 6 | --- 7 | Limits the number of items returned in an array. 8 | 9 | ```.language-yaml 10 | playlist: 11 | - Emancipator 12 | - Gong Gong 13 | - Possom Posse 14 | - Justin Bieber 15 | ``` 16 | 17 | Use with the pipe syntax to continue chaining in a single tag like so: 18 | 19 | ``` 20 | {{ playlist | limit:2 | join }} 21 | ``` 22 | 23 | ```.language-output 24 | Emancipator, Gong Gong 25 | ``` 26 | 27 | Or using the parameter syntax: 28 | 29 | ``` 30 | {{ playlist limit="2" }} 31 |
  • {{ value }}
  • 32 | {{ /playlist }} 33 | ``` 34 | 35 | ```.language-output 36 |
  • Emancipator
  • 37 |
  • Gong Gong
  • 38 | ``` 39 | -------------------------------------------------------------------------------- /content/collections/modifiers/safe_truncate.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: 1267d7b0-8a07-4103-9570-86327fb8e250 5 | --- 6 | Truncates the string to a given length (parameter 1), while ensuring that 7 | it does not split words. You can append a string with parameter 2, and if truncating occurs the string is further truncated so that it may be appended without exceeding the desired length. 8 | 9 | ```.language-yaml 10 | advice: > 11 | So, here’s some advice I wish I woulda got when I was your age: 12 | Live every week like it’s Shark Week. 13 | ``` 14 | 15 | ``` 16 | {{ advice | safe_truncate:90:... }} 17 | ``` 18 | 19 | ```.language-output 20 | So, here’s some advice I wish I woulda got when I was your age: 21 | Live every week like... 22 | ``` 23 | -------------------------------------------------------------------------------- /content/collections/kb/clear-cache.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: How do I clear the cache? 3 | kb_categories: 4 | - Tips, Tricks, and How-Tos 5 | id: fa5809bf-79e4-48cc-906f-625214391eaa 6 | --- 7 | If you have command line access, the easiest way to clear the cache is to use `please` command. 8 | 9 | ``` .language-bash 10 | php please clear:cache 11 | ``` 12 | 13 | If that's not working for some reason, and you are using the File cache driver (if you don't know what that means, then 14 | you are), you can manually delete the contents of `local/storage/framework/cache`. This is where Laravel stores any cached 15 | items. Clear this folder out, and the cache is gone. 16 | 17 | You can also clear the cache from the Control Panel by going to any settings area and hitting save. 18 | -------------------------------------------------------------------------------- /content/collections/variables/post.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: dc9c535d-59ac-475d-af4f-a0204a71f31b 3 | types: 4 | - global 5 | --- 6 | An array of sanitized `POST` variables that come from any form data present for a POST to the current URL. It can be used as a tag pair with access to all your data or as a single tag to access variables directly. A counterpart to `{{ get }}`. 7 | 8 | ``` 9 |
    10 | 11 | 12 |
    13 | ``` 14 | 15 | ``` 16 | {{ post }} 17 | {{ first_name }} {{ last_name }} 18 | {{ /post }} 19 | 20 | Mr. {{ post:last_name }} 21 | ``` 22 | 23 | ``` .language-output 24 | Niles Peppertrout 25 | 26 | Mr. Peppertrout 27 | ``` 28 | -------------------------------------------------------------------------------- /content/collections/kb/mixed-content.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Mixed Content Error" 3 | kb_categories: 4 | - Troubleshooting Common Scenarios 5 | id: 61f2d69c-9aee-4b02-a7be-3b9cae1a5a2d 6 | --- 7 | If you're getting a `Mixed Content` error: 8 | ``` 9 | Mixed Content: The page at 'https://yoursite.com/cp/collections/entries/stores' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://yoursite/cp/collections/entries/stores/get?sort=title&order=asc&page=1'. This request has been blocked; the content must be served over HTTPS. 10 | ``` 11 | 12 | when accessing your control panel, add `use_https: true` to your `system.yaml`. Also ensure your site url has `https` in it. 13 | 14 | If your assets have absolute URLs, `HTTPS=on` should be added to `.env`. 15 | -------------------------------------------------------------------------------- /content/collections/classes/api-globalset.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: GlobalSet 3 | class: Statamic\API\GlobalSet 4 | id: a53ff28d-8421-4bde-bfdf-7288942cc6d3 5 | --- 6 | We'd call this class `Global` if PHP was cool with it. But it isn't. 7 | 8 | ## Get all global sets. 9 | 10 | ``` php 11 | GlobalSet::all(); // Returns GlobalCollection 12 | ``` 13 | 14 | ## Get a global by ID. 15 | 16 | ``` php 17 | GlobalSet::find($id); // Returns GlobalSet 18 | ``` 19 | 20 | ## Get a global by handle. 21 | 22 | ``` php 23 | GlobalSet::whereHandle($handle); // Returns GlobalSet 24 | ``` 25 | 26 | ## Create a global. 27 | 28 | This returns an instance of a `GlobalFactory` to allow you to chain and build your global. 29 | 30 | ``` 31 | GlobalSet::create($handle); // Returns GlobalFactory 32 | ``` 33 | -------------------------------------------------------------------------------- /content/collections/kb/wrong-domain.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: My license belongs to another domain 3 | kb_categories: 4 | - Troubleshooting Common Scenarios 5 | id: 33984e54-475e-4a19-86af-05a0abe00192 6 | --- 7 | You've logged into the control panel and you're being told that your license belongs to another domain. 8 | 9 | You changed it. Great! But the message is still there. 10 | 11 | Just [clear your cache](/knowledge-base/clear-cache). 12 | 13 | Statamic only "calls home" once an hour and caches the response to prevent your site slowing down more than it needs to. 14 | When you update the domain in your Statamic license area, your Statamic site doesn't know anything changed. Clearing 15 | your cache will force your site to "call home" again, where it will notice your domain change. 16 | -------------------------------------------------------------------------------- /content/collections/tags/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Not Found (404) 3 | overview: Trigger a 404 response. 4 | id: 89f254ef-0312-429c-80bf-0a30a19edd0c 5 | canonical_url: https://statamic.dev/tags/404 6 | --- 7 | This tag will trigger a 404 status code and show your 404 template, without changing the URL. 8 | 9 | For performing a redirect, use the [Redirect Tag][redirect_tag]. 10 | 11 | ## Example {#example} 12 | 13 | In this example, we will trigger a 404 if there are no results in a collection. 14 | 15 | ``` 16 | {{ collection:blog as="posts" }} 17 | {{ if no_results }} 18 | {{ 404 }} 19 | {{ /if }} 20 | 21 | {{ posts }} 22 |
    {{ title }}
    23 | {{ /posts }} 24 | {{ /collection:blog }} 25 | ``` 26 | 27 | [redirect_tag]: /tags/redirect 28 | -------------------------------------------------------------------------------- /content/collections/classes/userfactory.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: UserFactory 3 | class: Statamic\Data\Users\UserFactory 4 | id: f45eafd5-9d59-4df6-ba88-fd49d0267fcc 5 | --- 6 | ## Usage 7 | 8 | Create a `UserFactory` using the API class. 9 | 10 | ``` 11 | $factory = Statamic\API\User::create(); 12 | ``` 13 | 14 | ## Available Methods 15 | 16 | ### with 17 | 18 | Add an array of data to the object. "Create an object _with_ this data." 19 | 20 | ``` 21 | $factory->with(['foo' => 'bar', 'baz' => 'qux']); 22 | ``` 23 | 24 | ### username 25 | 26 | Specify the username. 27 | 28 | ``` 29 | $factory->username('ron'); 30 | ``` 31 | 32 | ### email 33 | 34 | Specify the email address. This is an alias for passing the email in `with` data. 35 | 36 | ``` 37 | $factory->email('ron@swanson.com'); 38 | ``` 39 | -------------------------------------------------------------------------------- /content/collections/kb/duplicate-content.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "There's duplicate content on my site" 3 | kb_categories: 4 | - Troubleshooting Common Scenarios 5 | id: 4d1c5fe8-1b58-4384-931f-aaee97677c05 6 | --- 7 | Are you seeing two of the same entries? (or pages, assets, etc) If so, there may have been two files with the same 8 | ID in the front matter. 9 | 10 | This is fairly common to see when people copy/paste files and forget to remove the IDs. 11 | 12 | The solution is usually to just remove the duplicate ID and [clear your cache][clear_cache]. 13 | 14 | If it wasn't a duplicate ID causing the problem, it may just have been a glitch in the matrix. Let us know what went 15 | wrong and what you were doing, and we'll get that fixed up. 16 | 17 | [clear_cache]: /knowledge-base/clear-cache 18 | -------------------------------------------------------------------------------- /content/collections/tags/obfuscate.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Obfuscate 3 | id: 161f6255-465d-41bd-8028-d6aba01cebbf 4 | parse_content: false 5 | overview: | 6 | Obfuscation is a method of encoding content so that the source code is hard or impossible to understand. This is generally used on email addresses to prevent spambots from recognizing it as an email address and keeping you safe from unwanted emails. 7 | description: Obfuscate content (usually email addresses) to prevent screenscraping. 8 | --- 9 | ## Usage {#usage} 10 | 11 | ``` 12 | {{ obfuscate }} 13 | heisenberg@example.com 14 | {{ /obfuscate }} 15 | ``` 16 | 17 | ```.language-output 18 | # output appears as heisenberg@example.com 19 | heisenberg@example.com 20 | ``` 21 | -------------------------------------------------------------------------------- /content/collections/tags/user-not_in.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Not In (Group) 3 | overview: Check if a user is not in a specific user group. 4 | parameters: 5 | - 6 | name: group|groups 7 | type: string 8 | description: 'The groups(s) to check against. You may specify multiple groups by pipe separating them. eg. `{{ user:not_in group="foo" }}` or `{{ user:not_in groups="foo|bar" }}`' 9 | id: 4758a5ba-4b74-4031-8af7-6d165b1624d4 10 | --- 11 | ## Example {#example} 12 | 13 | We want to show a picture of delicious bacon if the user is not in the `vegans` group. 14 | 15 | ``` 16 | {{ user:not_in group="vegans" }} 17 | 18 | {{ /user:not_in }} 19 | ``` 20 | 21 | If the user is in the `vegans` group, the content between the tags simply won't be rendered. 22 | -------------------------------------------------------------------------------- /content/collections/modifiers/offset.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: 9433b8cd-b2e0-4fbf-85bd-85edf317efa4 6 | --- 7 | Offsets the items returned in an array. 8 | 9 | ```.language-yaml 10 | playlist: 11 | - Emancipator 12 | - Gong Gong 13 | - Possom Posse 14 | - Justin Bieber 15 | ``` 16 | 17 | Use with the pipe syntax to continue chaining in a single tag like so: 18 | 19 | ``` 20 | {{ playlist | offset:1 | join }} 21 | ``` 22 | 23 | ```.language-output 24 | Gong Gong, Possom Posse, Justin Bieber 25 | ``` 26 | 27 | Or using the parameter syntax: 28 | 29 | ``` 30 | {{ playlist offset="1" }} 31 |
  • {{ value }}
  • 32 | {{ /playlist }} 33 | ``` 34 | 35 | ```.language-output 36 |
  • Gong Gong
  • 37 |
  • Possom Posse
  • 38 |
  • Justin Bieber
  • 39 | ``` 40 | -------------------------------------------------------------------------------- /content/collections/kb/homepage-only.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Why can I only see the homepage? 3 | kb_categories: 4 | - Troubleshooting Common Scenarios 5 | id: 3365a1e0-4a1c-4cc5-8ed3-aada1ee81e2d 6 | --- 7 | The number 1 reason for this is because you don't have your URL rewrites set up. 8 | 9 | Out of the box, Statamic will omit `index.php` from URLs, because it's the "right" way to do things. That also means 10 | we assume you will have URL rewrites set up in one way or another. 11 | 12 | If you're running Apache, you're probably missing an `.htaccess` file. If you're running Nginx, you haven't set up 13 | rules in your `nginx.conf.` Statamic comes bundled with sample versions of these files. 14 | 15 | For more details, check out the [URL rewrite manual page](https://docs.statamic.com/installing#rewrites) 16 | -------------------------------------------------------------------------------- /content/collections/kb/trial-mode.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "What's Trial Mode?" 3 | kb_categories: 4 | - Tips, Tricks, and How-Tos 5 | id: 1791b60f-878c-4741-a2bf-a4997ad92a15 6 | --- 7 | Statamic will run in _Trial Mode_ (previously _Developer Mode_) if you're running on a non-public domain (like `.local` or `.test`). Our [article about how licensing works][licensing] explains how we define a public domain. 8 | 9 | This allows you to try out Statamic and even develop the site until you're ready to purchase licenses. 10 | 11 | Trial mode applies to the Statamic core as well as any commercial addons. 12 | 13 | What we recommend is to run Statamic locally on a `mysite.test` domain. Then, when you're ready: purchase your licenses, 14 | drop in the keys, and deploy your site. 15 | 16 | [licensing]: /licensing 17 | -------------------------------------------------------------------------------- /content/collections/tags/collection-count.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Count 3 | overview: Get the number of entries in a collection. 4 | parameters: 5 | - 6 | name: from|folder|use|in|collection 7 | type: string 8 | description: > 9 | The collection in which to count entries. All the parameters do the same thing - use whatever feels most natural 10 | in your templates. 11 | - 12 | name: collection params 13 | type: inheritance 14 | description: 'All parameters available on the [collection tag](/tags/collection) are also available here.' 15 | id: b888a242-ca4c-4a96-81ca-518bc5e3b085 16 | --- 17 | 18 | ## Example {#example} 19 | 20 | ``` 21 | There are {{ collection:count in="blog" }} blog posts. 22 | ``` 23 | 24 | ``` .language-output 25 | There are 10 blog posts. 26 | ``` 27 | -------------------------------------------------------------------------------- /content/collections/events/content-deleted.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ContentDeleted 3 | class: Statamic\Events\Data\ContentDeleted 4 | id: 3a226dda-2a67-41b6-904b-4471a558500b 5 | --- 6 | This is a [data event](/addons/events#data-events) that is dispatched when any Page, Entry, Taxonomy Term, or Global is deleted. 7 | 8 | ``` 9 | public function handle(ContentDeleted $event) 10 | { 11 | // In addition to data event methods, you get: 12 | $event->id; // The ID of the object that was deleted. 13 | } 14 | ``` 15 | 16 | If you require listening for more a more specific version, an event for the respective content type will also be dispatched: 17 | 18 | - `Statamic\Events\Data\PageDeleted` 19 | - `Statamic\Events\Data\EntryDeleted` 20 | - `Statamic\Events\Data\TermDeleted` 21 | - `Statamic\Events\Data\GlobalsDeleted` 22 | -------------------------------------------------------------------------------- /content/collections/classes/term.md: -------------------------------------------------------------------------------- 1 | --- 2 | class: Statamic\Data\Taxonomies\Term 3 | title: Term 4 | id: 1ec6a8eb-3e90-4302-8cc2-5048dd663e6d 5 | --- 6 | Inheritance: [Content](/addons/api/content) > [Data](/addons/api/data) 7 | 8 | ## taxonomy 9 | 10 | Get or set the associated taxonomy. You can pass either a string or a `Taxonomy`. 11 | 12 | ``` 13 | $term->taxonomy(); // Returns Taxonomy 14 | ``` 15 | ``` 16 | $term->taxonomy($taxonomy); // Returns null 17 | ``` 18 | 19 | ## taxonomyName 20 | 21 | Get or set the associated taxonomy. 22 | 23 | ``` 24 | $term->taxonomy(); // Returns a string, eg. 'tags' 25 | ``` 26 | ``` 27 | $term->taxonomy('tags'); // Returns null 28 | ``` 29 | 30 | ## count 31 | 32 | Get the number of content objects that use this term. 33 | 34 | ``` 35 | $term->count(); // Returns an integer 36 | ``` 37 | -------------------------------------------------------------------------------- /content/collections/modifiers/as.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: ada24ec2-1b6e-4759-b2c0-06d9d464f3f9 3 | types: 4 | - array 5 | - utility 6 | --- 7 | Alias an array variable with a key, giving you some useful markup/iteration options. 8 | 9 | ```.language-yaml 10 | blocks: 11 | - 12 | type: text 13 | content: I love to eat tacos in the bathroom. 14 | - 15 | type: photo 16 | photo: /assets/img/baño-tacos.jpg 17 | ``` 18 | 19 | ``` 20 | {{ blocks as="block" }} 21 | {{ block | partial:type }} 22 | {{ /blocks }} 23 | ``` 24 | 25 | ```.language-output 26 | 27 | 28 |
    29 |

    I like to eat tacos in the bathroom.

    30 |
    31 |
    32 | 33 |
    34 | ``` 35 | -------------------------------------------------------------------------------- /content/pages/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Statamic 2 Documentation 3 | template: home 4 | id: db0ae4e3-4f10-4802-bc40-0b880cbf02c7 5 | overview: | 6 | Statamic cuts out the database to create a faster, more productive way to build, manage, and version control beautifully creative, bespoke websites. 7 | --- 8 | By eliminating the rigid, relational database, we unlock the ability to create and support any data structures you can imagine, and provide you with a Control Panel that is flexible in ways you may assume are impossible. Statamic can scale to heights not possible with a MySQL database. 9 | 10 | Out of the box, Statamic runs on a flat file engine based on Markdown and YAML files and a smart caching system. As your site grows, you can take advantage of other storage mechanisms to scale up to sites as large as [spiegel.de](https://spiegel.de). 11 | -------------------------------------------------------------------------------- /content/collections/modifiers/modify_date.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - date 4 | id: 18596c62-5535-41a8-91c4-b5769fb11085 5 | parse_content: true 6 | --- 7 | Alters a timestamp by incrementing or decrementing in a format accepted by PHP's native [`strtotime()`](http://php.net/manual/en/function.strtotime.php) method. 8 | 9 | 10 | ```.language-yaml 11 | date: {{ now }} 12 | ``` 13 | 14 | {{ noparse }} 15 | ``` 16 | {{ date | modify_date:last Sunday }} 17 | {{ date | modify_date:+3 months }} 18 | {{ date | modify_date:-2 weeks }} 19 | ``` 20 | {{ /noparse }} 21 | 22 | ```.language-output 23 | {{ now | modify_date:last Sunday }} 24 | {{ now | modify_date:+3 months }} 25 | {{ now | modify_date:-2 weeks }} 26 | ``` 27 | 28 | > This modifier **modifies the variable directly** which will carry over to subsequent modifications, as shown in the above example. 29 | -------------------------------------------------------------------------------- /content/collections/modifiers/plural.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - array 4 | - utility 5 | id: d464d979-7e57-40a6-8892-a08d08bd7ccf 6 | --- 7 | Get the plural form of an English word. Accepts a numerical parameter, either as a literal value or a variable, to control plurality. It's important to note that you should use the singular form of the word to ensure the best results. 8 | 9 | ```.language-yaml 10 | shopping_list: 11 | - item: pickle 12 | quantity: 1 13 | - item: apple 14 | quantity: 12 15 | - item: donut 16 | quantity: 500 17 | ``` 18 | 19 | ``` 20 | Please pick up the following items: 21 | {{ shopping_list }} 22 | - {{ quantity }} {{ item | plural:quantity }}. 23 | {{ /shopping_list }} 24 | ``` 25 | 26 | ```.language-output 27 | Please pick up the following items: 28 | - 1 pickle 29 | - 3 apples 30 | - 500 donuts 31 | ``` 32 | -------------------------------------------------------------------------------- /content/collections/classes/api-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page 3 | class: Statamic\API\Page 4 | id: f871b95e-3861-43d2-957b-9002601eb52b 5 | --- 6 | ## Get all pages. 7 | 8 | ``` php 9 | Page::all(); // Returns PageCollection 10 | ``` 11 | 12 | ## Get a page by ID. 13 | 14 | ``` php 15 | Page::find($id); // Returns Page 16 | ``` 17 | 18 | ## Get a page by URI. 19 | 20 | ``` php 21 | Page::whereUri($uri); // Returns Page 22 | ``` 23 | 24 | ## Check if a page exists. 25 | 26 | ``` php 27 | Page::exists($id); // Returns a boolean 28 | ``` 29 | 30 | ## Check if a page exists by URI. 31 | 32 | ``` php 33 | Page::uriExists($uri); // Returns a boolean 34 | ``` 35 | 36 | ## Create a page. 37 | 38 | This returns an instance of a `PageFactory` to allow you to chain and build your page. 39 | 40 | ``` 41 | Page::create($uri); // Returns PageFactory 42 | ``` 43 | -------------------------------------------------------------------------------- /content/collections/modifiers/truncate.md: -------------------------------------------------------------------------------- 1 | --- 2 | types: 3 | - string 4 | id: cc80cc58-f73a-47fd-8f4d-e1cfc23c5d56 5 | --- 6 | Truncates the string to a given length (parameter 1). You can append a string with parameter 2, and if truncating occurs the string is further truncated so that it may be appended without exceeding the desired length. 7 | 8 | This differs from [safe_truncate][safe_truncate] in that it _may_ truncate in the middle of a word. 9 | 10 | ```.language-yaml 11 | advice: > 12 | So, here’s some advice I wish I woulda got when I was your age: 13 | Live every week like it’s Shark Week. 14 | ``` 15 | 16 | ``` 17 | {{ advice | truncate:90:... }} 18 | ``` 19 | 20 | ```.language-output 21 | So, here’s some advice I wish I woulda got when I was your age: 22 | Live every week like i... 23 | ``` 24 | 25 | [safe_truncate]: /modifiers/safe_truncate 26 | -------------------------------------------------------------------------------- /content/collections/variables/get.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 546c4334-df40-4e9a-aff4-a56c43e839d8 3 | types: 4 | - global 5 | --- 6 | An array of `GET` variables that come from any query strings present in the current URL. It can be used as a tag pair with access to all your parameters or as a single tag to access parameters directly. A counterpart to `{{ post }}`. 7 | 8 | 9 | Example URL: `/about?show=pants&hide=jeggings` 10 | 11 | ``` 12 | {{ get:show }} 13 | 14 | {{ get }} 15 | {{ show }} 16 | {{ hide }} 17 | {{ /get }} 18 | 19 | ``` 20 | 21 | ``` .language-output 22 | pants 23 | 24 | pants 25 | jeggings 26 | ``` 27 | 28 | Be sure to escape these values with the `sanitize` modifier if you plan to use them in output in production. 29 | 30 | ``` 31 | 32 | {{ get:jeggings | sanitize }} 33 | ``` -------------------------------------------------------------------------------- /content/collections/modifiers/table.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Table 3 | types: 4 | - string 5 | - markup 6 | - utility 7 | id: 4d8e0392-af96-4b46-a73a-d3a47b57ccbe 8 | --- 9 | Takes an array generated by the [Table Fieldtype](/fieldtypes/table), and converts into a basic HTML ``. 10 | 11 | ``` .language-yaml 12 | my_table: 13 | - 14 | cells: 15 | - One 16 | - Two 17 | - 18 | cells: 19 | - Three 20 | - Four 21 | ``` 22 | 23 | ``` 24 | {{ my_table | table }} 25 | ``` 26 | 27 | ``` .language-output 28 |
    29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
    OneTwo
    ThreeFour
    38 | ``` 39 | 40 | You can pass `true` as an argument to parse the cell data as markdown. 41 | 42 | ``` 43 | {{ my_table | table:true }} 44 | ``` 45 | -------------------------------------------------------------------------------- /content/pages/7.addons/9.api/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: API Reference 3 | id: 0bf69591-dd53-4bde-9bd7-0683ce5623de 4 | template: api 5 | overview: | 6 | Within your addons you will be able to access and manipulate content, data, and whatever else you can think of. In here, we explain all the classes you might care about and how to use them. 7 | --- 8 | Generally speaking, you should use the classes in the `Statamic\API` namespace as entry points to the API. 9 | 10 | However, methods in those classes, as well as other areas may return classes outside of the `Statamic\API` namespace. You will usually not need to create or instantiate these directly. 11 | 12 | For example, want to create an entry? You will use `Statamic\API\Entry::create()`, which returns an `Statamic\Data\Entries\EntryFactory`, which will eventually return 13 | a `Statamic\Data\Entries\Entry`. You wouldn't do `new Entry`. -------------------------------------------------------------------------------- /content/collections/classes/api-term.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Term 3 | class: Statamic\API\Term 4 | id: 7c3b86e0-f993-4eb4-8e36-1486b8e27937 5 | --- 6 | ## Get all terms. 7 | 8 | ``` php 9 | Term::all(); // Returns TermCollection 10 | ``` 11 | 12 | ## Get a term by ID. 13 | 14 | ``` php 15 | Term::find($id); // Returns Term 16 | ``` 17 | 18 | ## Get a term by slug (and taxonomy). 19 | 20 | ``` php 21 | Term::whereSlug($slug, $taxonomy); // Returns Term 22 | ``` 23 | 24 | ## Get a term by URI. 25 | 26 | ``` php 27 | Term::whereUri($uri); // Returns Term 28 | ``` 29 | 30 | ## Get all terms in a taxonomy. 31 | 32 | ``` php 33 | Term::whereTaxonomy($taxonomy); // Returns TermCollection 34 | ``` 35 | 36 | ## Create a term. 37 | 38 | This returns an instance of a `TermFactory` to allow you to chain and build your term. 39 | 40 | ``` 41 | Term::create($slug); // Returns TermFactory 42 | ``` 43 | --------------------------------------------------------------------------------