class NavItem (View source)

An object used by the Autonav Block to display navigation items in a tree.

Properties

bool|int $hasChildren
int|null $cID
string|null $cPath
$cPointerExternalLink
string|null $cPointerExternalLinkNewWindow
string|null $cvDescription
string|null $cvName
protected int $level
protected bool $isActive
protected Page $_c

Methods

void
__construct(array $itemInfo, int $level = 1)

Instantiates an Autonav Block Item.

int|bool
hasChildren()

Returns the number of children below this current nav item.

bool
isActive(Page|null $c)

Determines whether this nav item is the current page the user is on.

string
getDescription()

Returns the description of the current navigation item (typically grabbed from the page's short description field).

string
getTarget()

Returns a target for the nav item.

string
getURL()

Gets a URL that will take the user to this particular page. Checks against concrete.seo.url_rewriting, the page's path, etc.

string
getName()

Gets the name of the page or link.

int
getCollectionID()

Gets the pageID for the navigation item.

int
getLevel()

Gets the current level at the nav tree that we're at.

void
setCollectionObject(Page $obj)

Sets the collection Object of the navigation item to the passed object.

getCollectionObject()

Gets the collection Object of the navigation item.

Details

void __construct(array $itemInfo, int $level = 1)

Instantiates an Autonav Block Item.

Parameters

array $itemInfo
int $level

Return Value

void

int|bool hasChildren()

Returns the number of children below this current nav item.

Return Value

int|bool

bool isActive(Page|null $c)

Determines whether this nav item is the current page the user is on.

Parameters

Page|null $c

The page object for the current page

Return Value

bool

string getDescription()

Returns the description of the current navigation item (typically grabbed from the page's short description field).

Return Value

string

string getTarget()

Returns a target for the nav item.

Return Value

string

string getURL()

Gets a URL that will take the user to this particular page. Checks against concrete.seo.url_rewriting, the page's path, etc.

.

Return Value

string $url

string getName()

Gets the name of the page or link.

Return Value

string

int getCollectionID()

Gets the pageID for the navigation item.

Return Value

int

int getLevel()

Gets the current level at the nav tree that we're at.

Return Value

int

void setCollectionObject(Page $obj)

Sets the collection Object of the navigation item to the passed object.

Parameters

Page $obj

Return Value

void

Page getCollectionObject()

Gets the collection Object of the navigation item.

Return Value

Page