Content::column() 

\nn\t3::Content()->column($colPos, $pageUid = NULL, $slide = NULL); 

Loads the content for a specific column(colPos) and page. If no pageUid is specified, it uses the current page. With slide, the content element of the parent page is fetched if no content element exists in the column on the specified page.

Get content of colPos = 110 from the current page:

\nn\t3::Content()->column( 110 );
Copied!

Get content of colPos = 110 from the current page. If there is no content in the column on the current page, use the content from the parent page:

\nn\t3::Content()->column( 110, true );
Copied!

Get the content of colPos = 110 from the page with id 99:

\nn\t3::Content()->column( 110, 99 );
Copied!

Get content of colPos = 110 from the page with id 99. If there is no content in the column on page 99, use the content from the parent page of page 99:

\nn\t3::Content()->column( 110, 99, true );
Copied!

Also available as ViewHelper:

{nnt3:content.column(colPos:110)}
{nnt3:content.column(colPos:110, slide:1)}
{nnt3:content.column(colPos:110, pid:99)}
{nnt3:content.column(colPos:110, pid:99, slide:1)}
Copied!

| @return string

Source Code 

public function column($colPos, $pageUid = null, $slide = null)
{
	if ($slide === null && $pageUid === true) {
		$pageUid = null;
		$slide = true;
	}
	if (!$pageUid && !$slide) $pageUid = \nn\t3::Page()->getPid();
	$conf = [
		'table' => 'tt_content',
		'select.' => [
			'orderBy' => 'sorting',
			'where' => 'colPos=' . intval($colPos),
		],
	];
	if ($pageUid) {
		$conf['select.']['pidInList'] = intval($pageUid);
	}
	if ($slide) {
		$conf['slide'] = -1;
	}
	$html = \nn\t3::Tsfe()->cObjGetSingle('CONTENT', $conf);
	return $html;
}
Copied!