NAME

Podius::Component::Page - generic web page component (super class)


DESCRIPTION

This component class includes common web page properties, like ``title'' and simple methods dealing with them. This component class may be used in both multilingual and polylingual projects (see is_multilingual). The intended meaning of all properties follows.

english_name (in Multilingual components only) is a name of the component in English that is used for labeling mostly, it is shared among language clones (see the Podius::Component::Multilingual manpage). This is unlike name that is supposed to be in the language of this component.

role is usually a short internal (and usually unique) string describing the purpose of the component, for example ``home'' or ``news section''. This may be used to find the component and in some sense to name it. This property is shared among language clones.

title is intended to be used inside the HTML element of the same name, however the recommended way is to use get_title instead (that fallbacks to name if title is not set).

phrase is usually a short public phrase describing the component. This is somewhat similar to role, but is not shared among language clones, so it may be in the language of this component. Intended to be used in the published page name for this component. The method get_uri is a recommended way to do this (it fallbacks to name if phrase is not set, and converts space chars).

keywords is usually several phrases associated with this component separated by a comma. It is intended to be used in HTML element ``<meta keywords=...>''.

description is usually a paragraph describing this component. It is intended to be used in HTML element ``<meta description=...>''.

abstract is usually a short text, intended to be used (usually together with the abstract texts of other similar components) in summaries or search results. It may either participate in the content of the page in addition to body or include the same info body does just succinctly. The content editors should decide on which one of these two possibilities to take accourding to the project needs.

body is usually a long text in ``WikiText'' format. It is intended to be used as the main content on the published page. The recommended way is to use body_as_html method that converts ``WikiText'' to HTML.

Booleans is_active and is_secure may be used as arbitrary flags, but usually mark active components (the ones ready to be published/shown) and secure components (may be used to define 2 sets of page components in the project, one is to be published for use with HTTP and another with HTTPS servers).

image is of type UserScalableImage, see the Podius::Component::ScalableImage manpage. If there is no need to attach any images to this Page component, just ignore this property, and vice versa, if it needs more than one image, subclass and add properties image2 or main_photo and so on.


REQUIREMENTS

the Podius::Component::Publishable manpage, the Podius::Property::Scalar manpage, the Podius::Property::BigScalar manpage, the Podius::Property::WikiText manpage, the Podius::Property::Boolean manpage, the Podius::Property::UserScalableImage manpage.


METHODS

is_multilingual

description
This component class has 2 modes, it may inherit from either the Podius::Component::Publishable manpage or the Podius::Component::Multilingual manpage. Which mode is used is determined by $Podius::IS_MULTILINGUAL (that may be optionally set in conf/project.pl file.

This internal method just checks for the actual super-class and returns 0 if the super-type is Publishable and 1 if Multilingual.

get_name

description
This overridden method returns name, title, phrase or role (which ever is set in that order) or undef.

If positive boolean value is passed to this method meaning ``is for editor'' and when in the Multilingual mode, this method returns either english_name or role, if one of these properties is not empty. This way the interfaces that call this method with this flag may show the component name more predictable. I.e. when content editors know only a limited number of natural languages, but need to get some idea about what this component is all about anyway.

get_top_section

description
This is just a convenient method that returns the top-most Section container of this component or undef. It only works when your project has Section in the model (that may be true or not in your case).

get_title

description
Returns title or name.

get_phrase

description
Returns phrase or name.

get_abstract

description
Returns abstract or name.

get_uri

description
Similar to get_phrase, but converts all unsuitable characters into dashes.

get_page_by_id

description
Given the existing component id of another Page, retrieves and returns that component.

get_page_by_id_and_language

description
Given the existing component id of another Page and optionally language, retrieves and returns either it of its language clone with this language (if exists).

parameters

get_page_clone_by_id

description
Given the existing component id of another Page, retrieves and returns either it language, retrieves and returns either it of its language clone with the language equal to this component language (if exists).

find_page_by_role

description
Given the role, finds another Page with this role and returns it. In the Multilingual mode, the same language of this component is tried first or the default ``English''. If there are more than one component with the same role, then the first one is returned (this usually means random unpredictable results, so only use this method if you manage unique roles in the project components).

Parameters that the Podius::Persistense::ComponentCache manpage find_components accepts, like ``grep'', ``caching'' and similar are propagated to this method.


SEE ALSO

the Podius::Component manpage, the Podius::Component::Publishable manpage, the Podius::Component::Multilingual manpage, the Podius::Property::WikiText manpage, the Podius::Property::ScalableImage manpage.