> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/umbraco-cms/13.latest/reference/querying/ipublishedcontent/ishelpers.md).

# IPublishedContent IsHelpers

The IsHelper methods are a set of extension methods for IPublishedContent to help perform quick conditional queries against IPublishedContent nodes in a collection.

IsHelper methods are ternary operators, however they work a little nicer since they can be embedded in properties. They are also quicker to write because fewer brackets are needed for Razor to understand them.

***

## How to use

An IsHelper can be invoked as a method of an `IPublishedContent`.

```csharp
@{
if(item.IsVisible())
{
<a href="@item.Url()">@item.Name</a>
}
}
```

***

## IsHelper Methods

### IsComposedOf(string alias)

Test whether the content is of a content type composed of the given alias.

### IsAllowedTemplate(int templateId)

Test whether the specified `templateId` is an allowed template for the current node.

### IsAllowedTemplate(string templateAlias)

Test whether the specified `templateAlias` is an allowed template for the current node.

{% hint style="info" %}
By default the above template methods are disabled. To enable them, make sure to modify your appsettings.json to include the following JSON config keys inside Umbraco.CMS section:

```json
"WebRouting": {
    "ValidateAlternativeTemplates": true,
    "DisableAlternativeTemplates": false
 }
```

{% endhint %}

### .IsEqual(IPublishedContent otherNode\[,string valueIfTrue]\[,string valueIfFalse])

Test if the current node is equal (by Id) to another node.

### .IsNotEqual(IPublishedContent otherNode\[,string valueIfTrue]\[,string valueIfFalse])

Test if the current node is not equal (by Id) to another node.

### .IsDescendant(IPublishedContent otherNode\[,string valueIfTrue]\[,string valueIfFalse])

Test if the current node is a descendant of another node.

### .IsDescendantOrSelf(IPublishedContent otherNode\[,string valueIfTrue]\[,string valueIfFalse])

Test if the current node is the same as or a descendant of another node.

### .IsAncestor(IPublishedContent otherNode\[,string valueIfTrue]\[,string valueIfFalse])

Test if the current node is an ancestor of another node.

### .IsAncestorOrSelf(IPublishedContent otherNode\[,string valueIfTrue]\[,string valueIfFalse])

Test if the current node is the same as or an ancestor of another node.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umbraco.com/umbraco-cms/13.latest/reference/querying/ipublishedcontent/ishelpers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
