Child pages
  • Allow getting any field from current page [5.3.0-B1]
Skip to end of metadata
Go to start of metadata

Each page on website is represented by a category/section in the "Website & Content > Structure & Data" section. Some, but not all, of the page information can be easily accessed with the help of this tag:

<inp2:st_PageInfo type="..."/>

To be able to get just about any field of current page I'm proposing to add st_PageField tag with following code:

/**
 * Returns page field.
 *
 * @param array $params Tag params.
 *
 * @return string
 */
protected function PageField(array $params)
{
   /** @var kDBItem $page */
   $page =& $this->_getPage($params);

   if ( !$page->isLoaded() ) {
      // No associated category found for given template.
      return '';
   }

   return $this->Application->ProcessParsedTag($page->getPrefixSpecial(), 'Field', $params);
}

Related Tasks

1 Comment

  1. As it turns out the following tag can do that:

    <inp2:st_Field name="..."/>