November Happy Hour will be moved to Thursday December 5th.

Get VisibleInMenu using CMS api

Vote:
 

Hello, 

How can I get VisibleInMenu prop by calling {{baseUrl}}/api/episerver/v3.0/content/{{id}}/children?

In the response I can see many props but no VisibleInMenu

{
        "contentLink": {
            "id": 1742,
            "workId": 0,
            "guidValue": "a83d13df-acd6-4e24-bbbd-8ae61f06e2fb",
            "providerName": null,
            "url": "http://localhost:6666/test",
            "expanded": null
        },
        "name": "Lorem",
        "language": {
            "link": "http://localhost:6666/main/test",
            "displayName": "svenska",
            "name": "sv"
        },
        // ...
}

I'm trying to build a navigation component in the Next.JS/react by calling an Content Deliver Api v3.0 but without that information (VisibleInMenu) I'm unable to do it properly.

#305850
Jul 28, 2023 19:30
Vote:
 

Hi

Try setting ContentApiOptions.IncludeMetadataPropertiesPreview to true in your configuration. This should bring the field forward.

#305922
Jul 30, 2023 19:39
Vote:
 

Thanks mate! ❤ You have helped me a lot :) Seems like docs for it does not exist...

services.Configure<ContentApiOptions>(o =>
{
    // Makes api return content with all properties (eg VisibleInMenu)
    o.IncludeMetadataPropertiesPreview = true;
});
#305974
Jul 31, 2023 12:31
Stefan Holm Olsen - Jul 31, 2023 17:04
Happy to know it worked so well.
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.