Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin 114 posts 313 karma points
    Oct 30, 2015 @ 06:30
    Martin
    0

    TypedContent vs. Content vs. TypedContentAtXPath

    Hi,

    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?

    /Thanks Martin

  • stevenqb 7 posts 119 karma points
    Oct 30, 2015 @ 07:48
    stevenqb
    102

    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.

    The document for IPublishedContent and DynamicPublishedContent 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.

  • Martin 114 posts 313 karma points
    Oct 30, 2015 @ 08:12
    Martin
    0

    Thanks Steven!

Please Sign in or register to post replies

Write your reply to:

Draft