The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojolicious::Plugin::ContentManagement::Page - a managed content page

ATTRIBUTES

path

    my $path = $page->path;
    $page    = $page->path('/foo/bar.html');

The page identifying request url path

title

    my $title = $page->title;
    $page     = $page->title('My first pony');

The title of the page, probably used for navigations

html

    my $html = $page->html;
    $page    = $page->html('<h1>My first pony</h1><p>...');

The content of the page

raw

    my $raw = $page->raw;
    $page   = $page->raw('## My first pony');

The untranslated content of the page

children

    my $children = $page->children;
    $page        = $page->children([ $page2, $page3 ]);

Tree organisation of pages, probably used for navigations

title_editable

    my $editable = $page->title_editable;
    $page        = $page->title_editable(0);

If this is set to a true value, the admin interface offers an option to edit the title (which is not always possible, e. g. with the Filesystem source).

data

    my %data = %{ $page->data };
    $page    = $page->data({ foo => bar });

Source specific data. Please do not use it unless you're developing a source.

METHODS

clone

    my $page2 = $page1->clone;

Creates a clone of itself. Attention: children and data shared!

find

    my $p   = $page->find('/foo/bar.html');

Searches for a path in this page or the children and returns the matching page

SEE ALSO

Mojolicious::Plugin::ContentManagement