Skip to main content
Browse Documentation

Getting nodes

Created by Scott Yearsley, last modified by Simon Horan on 22 Jan 2020

Get root

Gets the root node of the tree.

Syntax

public Node GetRoot(string language = null, IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the root node for the default language
Node rootNode = client.Nodes.GetRoot();

Get root async

Gets the root node of the tree asynchronously.

Syntax

public async Task<Node> GetRootAsync(string language = null, IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the French root node asynchronously
Node rootNode = await client.Nodes.GetRootAsync("fr-FR");

Get by Guid id

Gets a node by its identifier as a Guid.

Syntax

public Node GetById(Guid id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

id

Type: Guid
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = client.Nodes.GetById(rootNavNodeId, language: "de");

// We can now create navigation components by looping through the nodes...

Get by Guid id async

Gets a node by its identifier as a Guid asynchronously.

Syntax

public async Task<Node> GetByIdAsync(Guid id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

id

Type: Guid
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = await client.Nodes.GetByIdAsync(rootNavNodeId, language: "de");

// We can now create navigation components by looping through the nodes...

Get by string id

Gets a node by its identifier as a string.

Syntax

public Node GetById(string id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

id

Type: string
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = client.Nodes.GetById("7ee53da5-6405-4fb5-80d4-b2752038134d", language: "de");

// We can now create navigation components by looping through the nodes...

Get by string id async

Gets a node by its identifier as a string asynchronously.

Syntax

public async Task<Node> GetByIdAsync(Guid id, string language = null, IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

id

Type: string
The id of the node.

language

Type: string
The specified language for the node. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Remarks

Returns null if a node with an id matching the specified id does not exist.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a specific German node by id
Node navNode = await client.Nodes.GetByIdAsync("7ee53da5-6405-4fb5-80d4-b2752038134d", language: "de");

// We can now create navigation components by looping through the nodes...

Get by path

Gets a node by path.

Syntax

public Node GetByPath(string path, IList<string> entryFields = null, entryLinkDepth = 0, bool allowPartialMatch = false)
{
}

Parameters

path

Type: string
The path to the node.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

allowPartialMatch

Type: bool
When set to true, returns the nearest ancestor up to, but not including, root on the path if the node at the specified path does not exist.

Remarks

Returns null if a node with the specified path does not exist.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a node by path
Node navNode = client.Nodes.GetByPath("/en-GB/movies/1995/toy-story");

Get by path async

Gets a node by path asynchronously.

Syntax

public async Task<Node> GetByPathAsync(string path, IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

path

Type: string
The path to the node.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Remarks

Returns null if a node with the specified path does not exist.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get a node by path
Node navNode = await client.Nodes.GetByPathAsync("/en-GB/movies/1995/toy-story");

Get by Guid entry id

Gets all nodes that have the specified entry assigned

Syntax

public IReadonlyList<Node> GetByEntryId(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = client.Nodes.GetByEntryId(entryId);

Get by Guid entry id async

Gets all nodes that have the specified entry assigned asynchronously

Syntax

public async Task<IReadonlyList<Node>> GetByEntryIdAsync(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = await client.Nodes.GetByEntryIdAsync(entryId);

Get by string entry id

Gets all nodes that have the specified entry assigned

Syntax

public IReadonlyList<Node> GetByEntryId(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = client.Nodes.GetByEntryId("ccd00f54-8c6a-4ea8-88ab-93cda601c181");

Get by string entry id async

Gets all nodes that have the specified entry assigned asynchronously

Syntax

public async Task<IReadonlyList<Node>> GetByEntryIdAsync(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get all nodes with the entry assigned
IReadonly<Node> nodes = await client.Nodes.GetByEntryIdAsync("ccd00f54-8c6a-4ea8-88ab-93cda601c181");

Get canonical by Guid entry id

Gets the canonical node that has the specified entry assigned

Syntax

public Node GetCanonical(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
Node node = client.Nodes.GetByEntryId(entryId);

Get canonical by Guid entry id async

Gets the canonical node that has the specified entry assigned asynchronously

Syntax

public async Task<Node> GetCanonicalAsync(Guid entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: Guid
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
Node node = await client.Nodes.GetCanonicalAsync(entryId);

Get canonical by string entry id

Gets the canonical node that has the specified entry assigned

Syntax

public Node GetCanonical(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
Node node = client.Nodes.GetByEntryId("ccd00f54-8c6a-4ea8-88ab-93cda601c181");

Get canonical by string entry id async

Gets all nodes that have the specified entry assigned asynchronously

Syntax

public async Task<Node> GetCanonicalAsync(string entryId, string language = null,
    IList<string> entryFields = null, entryLinkDepth = 0)
{
}

Parameters

entryId

Type: string
The entry identifier.

language

Type: string
The specified language for the nodes. If no value is provided then the project default language is used.

entryFields

Type: IList<string>
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

entryLinkDepth

Type: int
The fields to include for the entry (if attached) and any of it's linked entries if an entryLinkDepth value is included.

Examples

using Zengenti.Contensis.Delivery;

// Create a client
var client = ContensisClient.Create();

// Get the canonical node with the entry assigned
IReadonly<Node> nodes = await client.Nodes.GetCanonicalAsync("ccd00f54-8c6a-4ea8-88ab-93cda601c181");