How to filter a VirtualSubTree within Vendr by Store Id
Hi Matt,
Is it possible to perform contextual filtering on a collection based on the place it's being rendered?
For example, I have one particular collection that is used in both a ContextApp AND as a Vendr VirtualSubTree at Commerce > Stores > {StoreName} > My Collection.
The collection contains models like this:
[PrimaryKeyColumn(AutoIncrement = false)]
[Column("Id")]
public Guid Id { get; set; } = Guid.NewGuid();
[Column("contentUdi")]
public string? ContentUdi { get; set; }
[Column("storeId")]
public Guid? StoreId { get; set; }
[Column("productId")]
public Guid? ProductId { get; set; }
I am able to successfully filter the ContextApp using ContentUdi as a foreign key.
However I'm having trouble filtering the VirtualSubTree in Vendr. I only want to show models where StoreId matches the current Store (which is a parent of the VirtualSubTree).
How to filter a VirtualSubTree within Vendr by Store Id
Hi Matt,
Is it possible to perform contextual filtering on a collection based on the place it's being rendered?
For example, I have one particular collection that is used in both a ContextApp AND as a Vendr VirtualSubTree at Commerce > Stores > {StoreName} > My Collection.
The collection contains models like this:
I am able to successfully filter the ContextApp using ContentUdi as a foreign key.
However I'm having trouble filtering the VirtualSubTree in Vendr. I only want to show models where StoreId matches the current Store (which is a parent of the VirtualSubTree).
Is there anyway of doing that?
Any help is greatly appreciated! 🙏🏻
What does your virtual sub tree configuration look like?
Gah, don't worry, I think I've solved it.
I had to store all IDs as a string instead of a Guid.
is working on a reply...