What is the difference between Umbraco.Typedcontent and Umbraco.Content ? According to the Umbraco Helper documentation, both returns IPublishedContent with the difference that Content returns a IPublishedContent entity (what is the meaning of entity in this context?)
Is the difference simply that Typedcontent only returns published content wheras Content returns both unpublished and published content?
And what about Umbraco.TypedContentAtXPath, is it just an alternative method of querying, or what is best practice when to use or not to use regarding e.g. speed?
Umbraco.TypedContent return a IPublishedContent object while Umbraco.Content will return a DynamicPublishedContent object. Both of them return a published content.
Please see the definition of DynamicPublishedContent to get more information.
DynamicPublishedContent is the dynamic version of IPublishedContent,
it allows for simpler access to property data but it does not provide
intellisense. All methods and properties that are available on
IPublishedContent are also available on DynamicPublishedContnet.
However, there are a few special methods specifically designed for
DynamicPublishedContent that are used for filtering, querying and
collections.
Umbraco.TypedContentAtXPath is the method to get list of published content from cache by xpath. There are many methods to get list, it's depend on your requirement. Please looking for the documentation at here to get more information.
TypedContent vs. Content vs. TypedContentAtXPath
Hi,
What is the difference between
Umbraco.Typedcontent
andUmbraco.Content
? According to the Umbraco Helper documentation, both returnsIPublishedContent
with the difference thatContent
returns aIPublishedContent entity
(what is the meaning of entity in this context?)Is the difference simply that
Typedcontent
only returns published content wherasContent
returns both unpublished and published content?And what about
Umbraco.TypedContentAtXPath
, is it just an alternative method of querying, or what is best practice when to use or not to use regarding e.g. speed?/Thanks Martin
Umbraco.TypedContent
return aIPublishedContent
object whileUmbraco.Content
will return aDynamicPublishedContent
object. Both of them return a published content.Please see the definition of
DynamicPublishedContent
to get more information.The document for
IPublishedContent
andDynamicPublishedContent
are represent on the umbraco site.Umbraco.TypedContentAtXPath is the method to get list of published content from cache by xpath. There are many methods to get list, it's depend on your requirement. Please looking for the documentation at here to get more information.
Hope it helps you.
Thanks Steven!
is working on a reply...