How do I get wiki page detail from TaggedContent.List results?

I'm using this code to run a query on wiki pages searching by tag and I need to be able to get into the actual detailed content/properties of each of the wiki page result but can't seem to find/get the id's I need for the wikiPage.Get() function.

Looks like I need a contentId for this to work, but playing around in the sandbox, non of the contentId values returned in the TaggedContent.List() call return anything.

  • Former Member
    +1 Former Member

    $core_v2_taggedContent.List returns a paged list of AggregateTaggedContent. For each $item in the list, $item.Content.ContentId refers directly to the content identifier and would be usable in $core_v2_wikiPage.Get (as long as the ContentTypeId matches, as you've specified above in your query).

  • It's odd that it works when I put it directly in the Velocity code ($core_v2_wikiPage.Get($item.Content.ContentId)), but if I copy/paste one of the contentId's from the result and try to test it in the Script Sandbox, I don't get anything returned at all (when I'm expecting to see the WikiPage details).

  • Former Member
    0 Former Member in reply to wkopala

    You would need to convert the string into a GUID for the call to work in the sandbox.  $core_v2_wikiPage.Get  expects a GUID.

  • Thanks that's what I was missing.