Documentation

Node

Contains hierarchy and id information for the page it is a member of. 


OpenRoad.ThoughtFarmer.Core.Content.Composable.Node

Properties

Name Type Description
ContentId int The int representing the id for the page. This is the unique identifier for any given content in ThoughtFarmer.
ParentId int The int representing the id for the parent page. 
TreePath TreePath The TreePath object representing the pages preceding the current one in the site hierarchy.
Deleted boolean A boolean that signifies if the page is deleted or not.
LayoutId int An integer representing the layout ID for the page. 
InheritedHeaderBackgroundContentID int The content ID from which this page inherits its header image.

Methods

Name Return type Description
IsAParentOf(Node node) boolean Returns a boolean indicating if this page is in the tree path of the supplied Node object.
IEnumerable<Node> nodes boolean Returns a boolean indicating if this page is in the tree path of any of the supplied Node objects.

Example usage in custom cards
@if(this.Model.Context.Page.Node.ContenId == 123)
{
     // Code that will run only on the page with ContentID 123
}
 
@{
     var page = this.Api.Content.Get(123);
}

@if(this.Model.Context.Node.IsAParentOf(page.Node)) {
// Code that will run only on descendants of the section with ContentID 123 }