PageHtmlBuilderMeta
PageHtmlBuilderMeta
PageHtmlBuilderMeta provides non-html meta information to your views. You can access it over
PageHtmlBuilder::meta(). Like PageHtmlBuilder it looks up PageState
to determine the current page.
Constant summary
Methods summary
Modifier and Type | Method |
---|---|
public | __construct ( HtmlView view ) |
public PageState | getPageState ( ) |
public NavTree | getNavTree ( ) |
public boolean | hasCurrent ( ) |
public LeafContent | getCurrentLeafContent ( bool required = true ) |
public Leaf | getCurrentLeaf ( bool required = true ) |
public NavBranch | getCurrentNavBranch ( bool required = true ) |
public string | getTitle ( ) |
public | applyMeta ( string seTitle = null , string titleSeparator = self ) |
public | applySeMeta ( string seTitle = null , string titleSeparator = self ) |
public | applyN2nLocaleMeta ( ) |
public Url [] | getN2nLocaleSwitchUrls ( ) |
public string [] | getContentItemPanelNames ( ) |
public bool | containsContentItemPanelName ( string panelName ) |
public ContentItem [] | getContentItems ( string panelName ) |
public NavBranch [] | getBreadcrumbNavBranches ( ) |
Constants in detail
-
DEFAULT_TITLE_SEPARATOR
const DEFAULT_TITLE_SEPARATOR
Methods in detail
-
__construct
-
getPageState
PageState public getPageState ( )return
-
hasCurrent
boolean public hasCurrent ( )Returns true if there is a current page. -
getCurrentLeafContent
-
getCurrentLeaf
-
getTitle
string public getTitle ( )Returns the title of the current page or the page name specified in app.ini if there is no current page.return
string -
applyMeta
public applyMeta ( string seTitle = null , string titleSeparator = self )Combines PageHtmlBuilderMeta::applySeMeta() and PageHtmlBuilderMeta::applyN2nLocaleMeta()param
string seTitle See PageHtmlBuilderMeta::applySeMeta()string titleSeparator See PageHtmlBuilderMeta::applySeMeta() -
applySeMeta
public applySeMeta ( string seTitle = null , string titleSeparator = self )Applies meta information specified for the current page to the html header (e. g.
<title>
or<meta name="description" content=".." />
)If there is no current page nothing happens.
param
string <2>$seTitle $seTitle If you want to overwrite the title for the<title>
element.
string <2>$titleSeparator $titleSeparator The separator used to join the page title and the page name specified in app.ini together for<title>
element.
-
applyN2nLocaleMeta
public applyN2nLocaleMeta ( )Applies a<link rel="alternate" hreflang="de" href=".." />
element to the html header for every translation available for current page.
-
getN2nLocaleSwitchUrls
Url public getN2nLocaleSwitchUrls ( )Returns the Urls to every translation of the current page. If it is no translation available for a locale, a translation of its ancestors will be used. If they don't have a translation for this locale, the locale will be skiped.
If there is no current page, an empty array will be returned.
You can use this method to build a customized locale switch.
<ul> <?php foreach ($pageHtml->meta()->getN2nLocaleSwitchUrls() as $n2nLocaleId => $url): ?> <?php $n2nLocale = N2nLocale::create($n2nLocaleId) ?> <li<?php $view->out($n2nLocale->equals($view->getN2nLocale()) ? ' class="active"' : '') ?>> <?php $html->link($url, $n2nLocale->getName($view->getN2nLocale())) ?> </li> <?php endforeach ?> </ul>
return
-
getContentItemPanelNames
string public getContentItemPanelNames ( )return
string -
containsContentItemPanelName
bool public containsContentItemPanelName ( string panelName )return
bool -
getContentItems
Returns the ContentItems of to the current page which have been assigned to the panel with the passed name.param
string panelNamereturn
throws
UnknownContentItemPanelException if there is no panel with passed name defined.