Class PublishedContentExtensions
- Namespace
 - Umbraco.Extensions
 
- Assembly
 - Umbraco.Web.Common.dll
 
public static class PublishedContentExtensions
  - Inheritance
 - 
      
      PublishedContentExtensions
 
- Inherited Members
 
Methods
CreatorName(IPublishedContent, IUserService)
Gets the name of the content item creator.
public static string? CreatorName(this IPublishedContent content, IUserService userService)
  Parameters
contentIPublishedContentThe content item.
userServiceIUserService
Returns
GetCultureFromDomains(IPublishedContent, IUmbracoContextAccessor, ISiteDomainMapper, Uri?)
Gets the culture assigned to a document by domains, in the context of a current Uri.
public static string? GetCultureFromDomains(this IPublishedContent content, IUmbracoContextAccessor umbracoContextAccessor, ISiteDomainMapper siteDomainHelper, Uri? current = null)
  Parameters
contentIPublishedContentThe document.
umbracoContextAccessorIUmbracoContextAccessorsiteDomainHelperISiteDomainMappercurrentUriAn optional current Uri.
Returns
- string
 The culture assigned to the document by domains.
Remarks
In 1:1 multilingual setup, a document contains several cultures (there is not one document per culture), and domains, withing the context of a current Uri, assign a culture to that document.
IsAncestor(IPublishedContent, IPublishedContent, string)
public static IHtmlContent IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
  Parameters
contentIPublishedContentotherIPublishedContentvalueIfTruestring
Returns
IsAncestor(IPublishedContent, IPublishedContent, string, string)
If the specified content is an ancestor of other, the HTML encoded
valueIfTrue will be returned; otherwise, valueIfFalse.
public static IHtmlContent IsAncestor(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.valueIfFalsestringThe value if
false.
Returns
- IHtmlContent
 The HTML encoded value.
IsAncestorOrSelf(IPublishedContent, IPublishedContent, string)
public static IHtmlContent IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
  Parameters
contentIPublishedContentotherIPublishedContentvalueIfTruestring
Returns
IsAncestorOrSelf(IPublishedContent, IPublishedContent, string, string)
If the specified content is an ancestor of other or are the same, the HTML
encoded valueIfTrue will be returned; otherwise, valueIfFalse.
public static IHtmlContent IsAncestorOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.valueIfFalsestringThe value if
false.
Returns
- IHtmlContent
 The HTML encoded value.
IsDescendant(IPublishedContent, IPublishedContent, string)
If the specified content is a decendant of other, the HTML encoded
valueIfTrue will be returned; otherwise, Empty.
public static IHtmlContent IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.
Returns
- IHtmlContent
 The HTML encoded value.
IsDescendant(IPublishedContent, IPublishedContent, string, string)
If the specified content is a decendant of other, the HTML encoded
valueIfTrue will be returned; otherwise, valueIfFalse.
public static IHtmlContent IsDescendant(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.valueIfFalsestringThe value if
false.
Returns
- IHtmlContent
 The HTML encoded value.
IsDescendantOrSelf(IPublishedContent, IPublishedContent, string)
public static IHtmlContent IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
  Parameters
contentIPublishedContentotherIPublishedContentvalueIfTruestring
Returns
IsDescendantOrSelf(IPublishedContent, IPublishedContent, string, string)
If the specified content is a decendant of other or are the same, the HTML
encoded valueIfTrue will be returned; otherwise, valueIfFalse.
public static IHtmlContent IsDescendantOrSelf(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.valueIfFalsestringThe value if
false.
Returns
- IHtmlContent
 The HTML encoded value.
IsEqual(IPublishedContent, IPublishedContent, string)
If the specified content is equal to other, the HTML encoded
valueIfTrue will be returned; otherwise, Empty.
public static IHtmlContent IsEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.
Returns
- IHtmlContent
 The HTML encoded value.
IsEqual(IPublishedContent, IPublishedContent, string, string)
If the specified content is equal to other, the HTML encoded
valueIfTrue will be returned; otherwise, valueIfFalse.
public static IHtmlContent IsEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.valueIfFalsestringThe value if
false.
Returns
- IHtmlContent
 The HTML encoded value.
IsNotEqual(IPublishedContent, IPublishedContent, string)
If the specified content is not equal to other, the HTML encoded
valueIfTrue will be returned; otherwise, Empty.
public static IHtmlContent IsNotEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.
Returns
- IHtmlContent
 The HTML encoded value.
IsNotEqual(IPublishedContent, IPublishedContent, string, string)
If the specified content is not equal to other, the HTML encoded
valueIfTrue will be returned; otherwise, valueIfFalse.
public static IHtmlContent IsNotEqual(this IPublishedContent content, IPublishedContent other, string valueIfTrue, string valueIfFalse)
  Parameters
contentIPublishedContentThe content.
otherIPublishedContentThe other content.
valueIfTruestringThe value if
true.valueIfFalsestringThe value if
false.
Returns
- IHtmlContent
 The HTML encoded value.
SearchChildren(IPublishedContent, IExamineManager, IUmbracoContextAccessor, string, string?)
public static IEnumerable<PublishedSearchResult> SearchChildren(this IPublishedContent content, IExamineManager examineManager, IUmbracoContextAccessor umbracoContextAccessor, string term, string? indexName = null)
  Parameters
contentIPublishedContentexamineManagerIExamineManagerumbracoContextAccessorIUmbracoContextAccessortermstringindexNamestring
Returns
- IEnumerable<PublishedSearchResult>
 
SearchDescendants(IPublishedContent, IExamineManager, IUmbracoContextAccessor, string, string?)
public static IEnumerable<PublishedSearchResult> SearchDescendants(this IPublishedContent content, IExamineManager examineManager, IUmbracoContextAccessor umbracoContextAccessor, string term, string? indexName = null)
  Parameters
contentIPublishedContentexamineManagerIExamineManagerumbracoContextAccessorIUmbracoContextAccessortermstringindexNamestring
Returns
- IEnumerable<PublishedSearchResult>
 
WriterName(IPublishedContent, IUserService)
Gets the name of the content item writer.
public static string? WriterName(this IPublishedContent content, IUserService userService)
  Parameters
contentIPublishedContentThe content item.
userServiceIUserService