Copied to clipboard

Flag this post as spam?

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


  • Gayathri 55 posts 175 karma points
    Aug 08, 2017 @ 06:01
    Gayathri
    0

    Get content based on ID children inside children

    hi All,

    i am creating a news Module the News Title only showing the content not showing .

    enter image description here

    . so the News List is enter image description here

    and i wants to get the Content inside each News which is for example the first list when u click the detailed content is

    enter image description here

    when i tried to use the partialView i am using the code is

    enter image description here

    but i cant able to access the contents its only displaying the Name when i try to access the summary it throws error .

    so currently mycode is able to display only the List Level of News not the Detailed Level of content , can any one help me on this

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Aug 08, 2017 @ 06:25
    Dave Woestenborghs
    0

    hi Gayathri,

    Try item.GetPropertyValue<string>("summary") instead of Umbraco.Field("summary")

    Umbraco.Field will try to retreive the value from the current page you are rendering. In your case I guess this is your overview page, which doesn't have a summary property.

    item.GetPropertyValue<T> will get the value from the item in your loop.

    Dave

  • Gayathri 55 posts 175 karma points
    Aug 08, 2017 @ 06:28
    Gayathri
    0

    hi Dave,

    i got an error

    'umbraco.item' does not contain a definition for 'GetPropertyValue'

    the problem is i can access only the listview i am not able to access the inside each list contents , if i access the list inside content only i can able to access the summary.

    but i cant reach inside the List view contents

    ![enter image description here][1]

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Aug 08, 2017 @ 06:32
    Dave Woestenborghs
    0

    Hi Gayathri

    'umbraco.item' does not contain a definition for 'GetPropertyValue'

    This probably happens because you are missing a namespace in your view.

    Try adding this to the top of your view :

    @using Umbraco.Web;
    

    Dave

  • Gayathri 55 posts 175 karma points
    Aug 08, 2017 @ 06:38
    Gayathri
    0

    hi dave,

    after i have add which u mentioned is still issue

    enter image description here

    the issue the children is currently not taking the inside detailed view its taking only the list view so summary is not exist in the list view only Name is there , where i needs to access the list inside contents

    as i have mentioned i cant able to access the Particular values please check the above Reply

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Aug 08, 2017 @ 06:44
    Dave Woestenborghs
    100

    Hi Gayathri,

    I'm understand what you are trying to do.

    Maybe you can try this instead

    @item.GetPropertyValue("summary")
    

    Dave

  • Gayathri 55 posts 175 karma points
    Aug 08, 2017 @ 06:49
    Gayathri
    0

    hi Dave,

    OMG thank you , you saved my Day :)

Please Sign in or register to post replies

Write your reply to:

Draft