London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
I create an asset for a specific category (CMS -> Commerce -> Catalog -> select a category -> select All Properties -> Assets -> Add Media), indicate the name of the group. Then Publish changes.
public string GetNodeAssetUrl(NodeContent node, string groupName, bool relative) { string url = string.Empty; if (node?.CommerceMediaCollection == null || !node.CommerceMediaCollection.Any()) { return null; } var foundAsset = node.CommerceMediaCollection.FirstOrDefault( item => item.GroupName.ToLower().Contains(groupName.ToLower())); if (foundAsset == null) { return null; } if (!_contentLoader.Service.TryGet(foundAsset.AssetLink, out IContent content)) { return null; } ...
I always see that the content is null and foundAsset.AssetLink.ID == 0. Can someone tell me why is that so? I'm using version 12 of Epi.