Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate w/Content Delivery API & maintain backwards compatibility #97

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jessicarubinwilliams
Copy link

The UmbNav library is not currently compatible with the Umbraco Content Delivery API. To use the library with the content delivery API currently requires creating custom overrides within a given application. This PR implements the necessary code to allow for the UmbNav library to return useful content via the Umbraco Content Delivery API in versions of Umbraco that have Umbraco Content Delivery API available (v12 and up).

Without either custom overrides or this update to the library itself, when returning UmbNavItems via the Content Delivery API I received an alternating experience between a 500 error and content stuck in a recursive loop (the json ignore attribute on content in class UmbNavItem is not recognized by the content delivery api because the existing class, UmbNavValueConverter only extends PropertyValueConverterBase but does not also implement IDeliveryApiPropertyValueConverter).

See this issue for greater detail: #96

jessicaw-iology and others added 2 commits January 10, 2025 18:08
…ery-api-compatibility

Integrate w/Content Delivery API & maintain backwards compatibility
@@ -9,6 +9,9 @@ namespace UmbNav.Core.Models
{
public class UmbNavItem
{
[JsonProperty("url")]
public string Url { get; set; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is necessary to make this property public in order for the property to be returned via the Content Delivery API. Without this property an UmvNavItem's content is not useful via the Content Delivery API.

Copy link
Owner

@AaronSadlerUK AaronSadlerUK Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs thinking about, this is private as the extension is the correct way to return the URL due to the culture property.

How would you normally handle links within the core? (When you would normally use the .Url() extension?

I haven't used the content API myself

@AaronSadlerUK AaronSadlerUK added the enhancement New feature or request label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants