Class ContentTypesQueryParametersExtensions
Content types query parameters extension methods related to web pages.
public static class ContentTypesQueryParametersExtensions
- Inheritance
-
objectContentTypesQueryParametersExtensions
Methods
ForWebsite(ContentTypesQueryParameters, bool)
Limits the collection of retrieved content types to web page items.
public static ContentTypesQueryParameters ForWebsite(this ContentTypesQueryParameters parameters, bool includeUrlPath = true)
Parameters
parametersContentTypesQueryParametersContent type query parameters.
includeUrlPathboolIndicates if page URLs should be included in the retrieved data.
Returns
Exceptions
- ArgumentNullException
Thrown when
parametersis null.- InvalidOperationException
When the 'ForWebsite' method has been called previously.
ForWebsite(ContentTypesQueryParameters, IEnumerable<Guid>, bool)
Limits the collection of retrieved content types to web page items with the provided identifiers.
public static ContentTypesQueryParameters ForWebsite(this ContentTypesQueryParameters parameters, IEnumerable<Guid> identifiers, bool includeUrlPath = true)
Parameters
parametersContentTypesQueryParametersContent type query parameters.
identifiersIEnumerable<Guid>Identifiers of web page items.
includeUrlPathboolIndicates if page URLs should be included in the retrieved data.
Returns
Exceptions
- ArgumentNullException
Thrown when
parametersoridentifiersis null.- InvalidOperationException
When the 'ForWebsite' method has been called previously.
ForWebsite(ContentTypesQueryParameters, IEnumerable<int>, bool)
Limits the collection of retrieved content types to web page items with the provided identifiers.
public static ContentTypesQueryParameters ForWebsite(this ContentTypesQueryParameters parameters, IEnumerable<int> identifiers, bool includeUrlPath = true)
Parameters
parametersContentTypesQueryParametersContent type query parameters.
identifiersIEnumerable<int>Identifiers of web page items.
includeUrlPathboolIndicates if page URLs should be included in the retrieved data.
Returns
Exceptions
- ArgumentNullException
Thrown when
parametersoridentifiersis null.- InvalidOperationException
When the 'ForWebsite' method has been called previously.
ForWebsite(ContentTypesQueryParameters, IEnumerable<string>, bool)
Limits the collection of retrieved content types to web page items with the provided identifiers.
public static ContentTypesQueryParameters ForWebsite(this ContentTypesQueryParameters parameters, IEnumerable<string> identifiers, bool includeUrlPath = true)
Parameters
parametersContentTypesQueryParametersContent type query parameters.
identifiersIEnumerable<string>Identifiers of web page items.
includeUrlPathboolIndicates if page URLs should be included in the retrieved data.
Returns
Exceptions
- ArgumentNullException
Thrown when
parametersoridentifiersis null.- InvalidOperationException
When any of the 'ForWebsite' methods has been called previously.
ForWebsite(ContentTypesQueryParameters, string, PathMatch, bool)
Limits the collection of retrieved content types to web page items that belong to the provided websiteChannelName and pathMatch.
public static ContentTypesQueryParameters ForWebsite(this ContentTypesQueryParameters parameters, string websiteChannelName, PathMatch pathMatch = null, bool includeUrlPath = true)
Parameters
parametersContentTypesQueryParametersContent type query parameters.
websiteChannelNamestringName of the website channel.
pathMatchPathMatchWeb page tree path for which the query should be limited.
includeUrlPathboolIndicates if page URLs should be included in the retrieved data.
Returns
Exceptions
- ArgumentNullException
Thrown when
parametersis null.- InvalidOperationException
When the 'ForWebsite' method has been called previously.
SetUrlLanguageBehavior(ContentTypesQueryParameters, UrlLanguageBehavior)
Defines the behavior for URL paths of web pages in fallback languages when content query is configured with InLanguage(string, bool).
public static ContentTypesQueryParameters SetUrlLanguageBehavior(this ContentTypesQueryParameters parameters, UrlLanguageBehavior urlLanguageBehavior)
Parameters
parametersContentTypesQueryParametersContent types query parameters.
urlLanguageBehaviorUrlLanguageBehaviorURL language behavior.
Returns
Remarks
This behavior applies to web pages retrieved using 'ForWebsite', 'WithWebPageData' and 'WithLinkedItems' methods.
When limiting retrieved columns via the 'Columns' query parameterization, call UrlPathColumns(ContentQueryParameters) to ensure all data necessary for URL resolution.
WithWebPageData(ContentTypesQueryParameters, bool)
Adds website-specific data, such as content tree path, page order and URL path (optional see includeUrlPath), to the result. Only affects web page items. Other content types in the result are not affected.
public static ContentTypesQueryParameters WithWebPageData(this ContentTypesQueryParameters parameters, bool includeUrlPath = true)
Parameters
parametersContentTypesQueryParametersContent type query parameters.
includeUrlPathboolIndicates if the URL path should be included in the retrieved data.
Returns
Remarks
Unlike ForWebsite(ContentTypesQueryParameters, IEnumerable<Guid>, bool), which ensures identical website-specific data for web page items, this method does not scope the result to only web page content types.
For example, when querying for data via reusable field schemas that contain a combination of reusable and web site content types, you can use this method to ensure web page data without pruning other content types from the result.