Giter Site home page Giter Site logo

geta / geta-optimizely-categories Goto Github PK

View Code? Open in Web Editor NEW
5.0 8.0 9.0 236.3 MB

An alternative to Optimizely's default category functionality, where categories are instead stored as localizable IContent.

C# 63.46% JavaScript 9.42% HTML 22.80% CSS 0.23% Batchfile 0.23% TSQL 0.15% Shell 0.09% SCSS 3.59% ASP.NET 0.03%
cms commerce episerver optimizely

geta-optimizely-categories's People

Contributors

brianweet avatar frederikvig avatar marisks avatar valdisiljuconoks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geta-optimizely-categories's Issues

Geta.Optimizely.Categories.Find and trash search

When Geta.Optimizely.Categories.Find is installed it can modify the behavior of searches on trash in the CMS which causes missing or no results.

When that package is installed the JSON sent to search has the parent folder set to 59266, which is "For all sites". When the package is uninstalled the parent folder is set to ID 2, which is the trash folder.

See the searches which work and fail here.

trash_searches.zip

Media folder "For this" shows with handlebars when on a category.

How to Reproduce:

  1. Go into the CMS Editor interface
  2. In the media pane, select the categories tab
  3. Click on any category to edit it
  4. Click on the media pane as if to choose an image to attach to the categories

Expected Behaviour: "For this..." shows as "For this category" (or equivalent)

Actual Behaviour: "For this..." shows as "For this {0}"

image

Support for .net 6.0

Hello,

Will there be support provided for Optimizely CMS 12 targetting .net 6.0 as .net 5.0 reached end of support already. As it lists only .net 5.0 under dependencies.

Thanks,

Deepa

Only one category is visible in the category selector widget when [Categories] attribute is used on the item in a list property

Issue description

Categories attribute is not working properly when the item that uses it is added in a list property (https://world.optimizely.com/blogs/Per-Magne-Skuseth/Dates/2015/11/trying-out-propertylistt/)

Multiple categories can be selected, but after closing and reopening an item, only one category is selected.

How to reproduce

Below is the example that uses Alloy site.

  1. Install Geta.Optimizely.Categories nuget package (version 1.1.1) and define some categories
[ContentType]
public class BasicCategory : CategoryData
{
}

[ContentType]
public class ExtendedCategory : BasicCategory
{
    [CultureSpecific]
    public virtual XhtmlString MainBody { get; set; }
}
  1. Modify StadardPage to include property of type IList<T> where T is a new class with a list of categories as a property (in my example ItemWithCategories:
[SiteContentType(GUID = "9CCC8A41-5C8C-4BE0-8E73-520FF3DE8267")]
[SiteImageUrl(Globals.StaticGraphicsFolderPath + "page-type-thumbnail-standard.png")]
public class StandardPage : SitePageData
{
    [Display(
        GroupName = SystemTabNames.Content,
        Order = 310)]
    [CultureSpecific]
    public virtual XhtmlString MainBody { get; set; }

    [Display(
        GroupName = SystemTabNames.Content,
        Order = 320)]
    public virtual ContentArea MainContentArea { get; set; }
    
    [EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor<ItemWithCategories>))]
    public virtual IList<ItemWithCategories> ItemsWithCategories { get; set; }
}

public class ItemWithCategories
{
    [Display(
        Name = "Name",
        GroupName = SystemTabNames.Content,
        Order = 10)]
    public string Name { get; set; }
    
    [Display(
        Name = "Test categories",
        GroupName = SystemTabNames.Content,
        Order = 20)]
    [AllowedTypes(typeof(ExtendedCategory))]
    [Categories]
    public virtual IList<ContentReference> Categories { get; set; }
}

[PropertyDefinitionTypePlugIn]
public class ItemWithCategoriesListProperty : PropertyList<ItemWithCategories>
{
}
  1. Add page of that type in CMS and add item to the list selecting multiple categories

image

image

  1. Ids are correctly saved and show in the item list

image

  1. But when I open that item again only one category is selected

image

  1. If I click OK button, it will override saved category
    image

Expected behavior

When list item is edited it should display all categories.

Notes

Similar situation is happening when list property for inline block is used: https://world.optimizely.com/blogs/bartosz-sekula/dates/2023/1/official-list-property-support/

Possible solution

I've found that code in EPiServer/Shell/12.25.1/ClientResources/epi/shell/widgets.js for epi/patch/dijit/form/_FormMixin inovke set method on descendant widgets, but it checks multiple flag. If it is set to true it passes the whole array, but if not, then, in this case, it only passes the first element from the array.

Adding a line like this:

additionalValue.EditorConfiguration["multiple"] = (object)true;

In the CreateDicplayMetadata method in CategoriesAttribute solves this issue and all categories are properly shown.

Category selector is incompatible with .NET 8

We upgraded our projects to .NET 8 but needed to go back to .NET 6 because the geta category selector is not compatible and we get errors in the console wherever we use it in the cms:

geta_errors

Edit: It seems that geta categoeries 1.1.1 even has issues with .NET 6, so we rolled back to 1.0.0. So maybe .NET 8 is not the problem but 1.1.1

Performance issue

Hi,

If there is a large number of categories with multiple levels, performance is seriously affected when loading the category tree.
Could you look into this?

Regards,
Torunn

Configuring Geta.Optimizely.Categories 'Select Categories' tree

Greetings:

I'm new to Geta.Optimizely.Categories and to Optimizely CMS and I have built a Categories prototype with using the Alloy demo site. Everything seems to be working well and I can control my categories in the way that's needed except for one case...

In my 'Select Categories' tree, I need to only display the parent-child category types for a given category and only child types should be selectable(allowed). I've tried the following combinations of appsettings and AllowedType attribution but, at best, have only been able to meet 2 of my 3 goals.

I'm hoping that you can provide some guidance about whether all 3 goals can be achieved and, if so, how to go about achieving it -or- if this is a new capability that should be added to the App?

Regards,
Matt

Goals:

In Select Categories tree:

  1. Display ProductCat1(parent) as RestrictedType
  2. Display ProductChildCat1 & ProductChildCat2 as AllowedTypes
  3. Do not display any other parent types such as NewsCat1 and SearchCat1

image

Try 1:

Config:

  • AllowedTypes: ProductCat1, ProductChildCat1 & ProductChildCat2
  • HideDisallowedRootCategories = true

Result: In Select Categories tree

  1. Fail-ProductCat1(parent) displays as an AllowedType
  2. Pass-ProductChildCat1 & ProductChildCat2 display as AllowedTypes
  3. Pass-Do not display any other parent types such as NewsCat1 and SearchCat1

image

Try 2:

Config:

  • AllowedTypes: ProductChildCat1 & ProductChildCat2
  • RestrictedTypes: ProductCat1
  • HideDisallowedRootCategories = true

Result: In Select Categories tree -

  1. Fail-ProductCat1(parent) does not display.
  2. Fail-ProductChildCat1 & ProductChildCat2 do not display.
  3. Pass-Do not display any other parent types such as NewsCat1 and SearchCat1

image

Try 3:

Config:

  • AllowedTypes: ProductChildCat1 & ProductChildCat2
  • RestrictedTypes: ProductCat1
  • HideDisallowedRootCategories = false

Result: In Select Categories tree -

  1. Pass-Display ProductCat1(parent) as RestrictedType
  2. Pass-Display ProductChildCat1 & ProductChildCat2 as AllowedTypes
  3. Fail-Do not display any other parent types such as NewsCat1 and SearchCat1

image

Custom sort order of categories

Is there a way to add sort order for the categories so that we can have it in the order we need instead of alphabetic order which is default?

Cannot add Category Types from Optimizely CMS UI Admin->Content Types

Greetings:

I'm new to Optimizely CMS and Geta Optimizely Categories. So, not sure if this issue is due to the app or if I have just not figured out the way it can or should be done...

I've added the Geta Optimizely Categories package to my Optimizely Alloy demo project and created a couple of Category content types (ProductCategory & NewsCategory) in the code.

When going to Settings->Content Types in the Optimizely CMS UI, I can see the Category content types that were added via the code:

image

However, when clicking on the 'Create New...' button, the drop-down list displays selectable Page and Block content types but there is no selectable item for creating a new Category content type.

image

Is there a way to add a Geta Category content type from the Optimizely CMS UI? If so, how? / What is the procedure – do we need to register the Category content type somehow so that it appears in the ‘Create New…’ drop-down list? -or- do all Geta Category content types need to be added via the code? If all Geta Category types need to be added via code today, then should this issue be a request for a future enhancement?

Regards,
Matt

Creating a Category Property for a Page via the Optimizely CMS UI

Greetings:

I’ve added ProductCategory and NewsCategory properties to our ProductPageData class(inherits from EPiServer PageData) in the code. These properties are visible from the Optimizely CMS UI by going to Settings->Content Types->ProductPage:

image

image

Additionally, I have added a Search Category to ProductPage using the Optimizely CMS Admin UI(rather than code) by selecting Settings->Content Types->Product->Add Property:

image

When adding a Category via code, the Allowed and Restricted content types are specified in the [AllowedTypes] attribute:

image

A notable difference when adding a Category content type via the UI is that the Allowed Content Types and Restricted Content Types appear as settings in the UI under Configure Properties.

The issue that I'm seeing is that the drop-down list of content values for Allowed Content Types and Restricted Content Types do not have any Category Types in the select list. Instead, Page, Block and Media content types appear in the select list:

image

image

Just reaching out to see if it is possible to 'register' the Category content types so that they appear in the Allowed & Restricted Content Type drop-down select lists when creating a new Category property for a Page via the UI? If Allowed and Restricted Types cannot be specified via the UI today, then is this possibly a future enhancement that should be added to the Geta Category App in the future?

Regards,
Matt

Exception: Failed to load content type with name 'CategoryData' during Import

Similar to the issue for EpiCategories this happens also for the optimizely categories.
EpiCategories issue (closed as completed, but how?)
EpiCategories forum post
Optimizely.Categories forum post

So the error is:

2023-11-10 18:56:49.517 +01:00 [ERR] 10.5.3 Export/import error: Exception: Failed to load content type with name 'CategoryData'
EPiServer.DataAbstraction.DataAbstractionException: Failed to load content type with name 'CategoryData'
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeMappingAnalyzer.GetContentType(String contentTypeName)
at EPiServer.DataAbstraction.RuntimeModel.Internal.ContentTypeMappingAnalyzer.Analyze(ContentType contentType, AvailableSetting settings, IContentTypeAvailableModelSetting modelsetting)
at EPiServer.DataAbstraction.Internal.AvailableSettingsRepository.RegisterSetting(ContentType contentType, AvailableSetting setting)
at EPiServer.Enterprise.Transfer.Internal.AllowedContentTypesTransfer.ImportInternal(IEnumerable`1 transferObjects)
at EPiServer.Enterprise.Transfer.Internal.AllowedContentTypesTransfer.Import(XmlTextReader input)
at EPiServer.Enterprise.Internal.DefaultDataImporter.ImportStream(ZipPackage package, XmlTextReader reader, String partName, ImportOptions options)
at EPiServer.Enterprise.Internal.DefaultDataImporter.ImportPartOfPackage(ZipPackage package, String partName, ImportOptions options)
at EPiServer.Enterprise.Internal.DefaultDataImporter.ImportRaw(ZipPackage package, ImportOptions options)
at EPiServer.Enterprise.Internal.DefaultDataImporter.Import(ImportOptions options)

Can't select category with subcategories

In Optimizely 12, if we add the UIHint attribute:

[UIHint(CategoryUIHint.Category)],

the category selector doesn't allow us to select a category that has sub categories.

As you can see in the image, the main category doesn't get a checkbox.
Is this a bug?

category

Multiple category selector issue

So following this part of the documentation:

If you prefer to use the native content reference list editor for your categories you can skip the CategoriesAttribute:

[AllowedTypes(typeof(TopicCategory))]
public virtual IList<ContentReference> TopicCategories{ get; set; }

If I implement the above, then it never shows any categories, it just displays the root node:

757b0314-78d2-42e8-817a-92575985ed12

If I implement the single category property, it displays fine:

[UIHint(CategoryUIHint.Category)]
[AllowedTypes(typeof(TopicCategory))]
public virtual ContentReference TopicCategory{ get; set; }

image

Release Timelines

Hello Geta,

Do you know when this package will be ready for CMS12 .NET 5/6? Is assistance required to get this closer toward release?

Regards,
Mark

Cannot create categories under Category Root

We are experiencing issues as well when trying to create Categories.

Is works locally but not in DXP.

It breaks when using New Item under For All Sites (CategoryRoot).

"Unable to load /EPiServer/cms/Stores/contenttype/?query=getsuggestedcontenttypes&localAsset=false&parentReference=451&requestedTypes=geta.optimizely.categories.categorydata status: 500"

ID 451 would be For All Sites (CategoryRoot) node.

Using version 1.1.1
And CMS 12.25.1

Separating a nuget for the UI components

We are building an enterprise application with multiple levels of abstraction and we want to have one NuGet containing base content types and interfaces and one with the content editor plugins, UI components and modules/protected.

Can this be achieved using your solution and if not do you know any other more suitable solution, because we are still considering what to use?

Category Picker Scrollbar is broken on scaled UI at 150% or at a smaller browser height

We have found an issue opening the Geta Categories picker where the page already has multiple selected categories. This issue affects smaller brower windows and normal desktop windows were scaling is in use such that the effective or scaled viewport is 620 pixels or less.

Browser: Chrome, HD Desktop, Zoom at 150% or Larger
Browser: FireFox, HD Desktop, Zoom at 160% or larger
Browser: Chrome, View Height <620 pixels
Browser: FireFox, View Height <620 pixels
Category Tree:

  • For All Sites
    • Content Types
      • Blog
      • Event
      • News
      • Offer
    • Rooms
      • Duplex
      • Penthouse
      • Suite
      • Standard
    • Topic
      • Celebration
      • Conference
      • Luxury Break
      • Wedding

Steps to Reproduce Based on Chrome and 150% zoom, On FireFox this happens at 160%:

  1. Assign a Sub Category from under each top level category to your page and publish it.
  2. Open the Category Picker with your browser zoom to 100% or 125% - Note that the scrolling works as expected.
  3. Open the Category Picker with your browser zoom at 150% or larger - Note that the scrolling does not work and parts of the category tree cannot be clicked

Steps to Reproduce based on limited View Height

  1. Open the browser at full screen height
  2. Assign a Sub Category from under each top level category to your page and publish it.
  3. Resize the browser window so the view port is less than 620 pixels in height e.g. like a smaller laptop or tablet. Note that the scroll bar does not work.
  4. Resize the browser window so the view port is 620 pixels or greater. Note that the scrolling does not work and parts of the category tree cannot be clicked

Category Picker

Category Picker doesn't update values on Inline Blocks (CMS 12.22.2)

We have the following block that we use for building up filters:

[ContentType(DisplayName = "Category Filter Block", GUID = "CDAC6F24-2175-4BEA-AC34-D6CA17E45884", GroupName = GroupNames.Content)]
[ContentTypeIcon(FontAwesome.Filter)]
public class CategoryFilterBlock : BlockData
{
    [Display(Name = "Label", GroupName = GroupNames.Content, Order = 10)]
    [CultureSpecific]
    [Required]
    public virtual string? Label { get; set; }

    [Display(Name = "Filter Categories", GroupName = GroupNames.Content, Order = 20)]
    [Categories]
    [CultureSpecific]
    [Required]
    public virtual IList<ContentReference>? FilterCategories { get; set; }
}

When creating this as a shared block (e.g. created under For This Site, For This Page) then the category picker works as intended and results in changes to the category picker being retained.

When creating this as an inline block directly in the content area, then only the categories set at the point of creation are applied. Any further updates to these on the block are not retained.

Steps to Reproduce:

  • Go to a page with a content area
  • Create a new block within the content area
  • Set the categories
  • Save the block
  • Publish the page.
  • Edit the block
  • Change the categories
  • Save the block
  • Publish the page.
  • Check the block values ... Note that the update to categories was not retained.

I have also noted the same issue if I try and use the same block in a new block property list, e.g.

public virtual IList<CategoryFilterBlock>? FilterCategories { get; set; }

[Change Request] Add an overload for ContentCategoriesFacet() which allows the definition of the TermsFacetRequest

The current implementation of ContentCategoriesFacet() is nice in that it wraps up the facets for categories really nicely. However the default facet size is 10 and since this method does not take any other arguments, you cannot override the facet limit while using this method.

In order to facilitate my client's needs, I've have to look at what the ContentCategoriesFacet() method is doing in order to supply my own limit.

Work around:

var results = query.FilterForVisitor()
                   .Skip(request.From)
                   .Take(request.Take)
                   .OrderByDescending(x => x.StartPublish)
                   //.ContentCategoriesFacet()
                   .TermsFacetFor(x => x.Categories(), y => y.Size = 100 )
                   .GetContentResult();

Potential overloads options:

public static ITypeSearch<T> ContentCategoriesFacet<TSource>(this ITypeSearch<T> search, Action<TermsFacetRequest> facetRequestAction)

public static ITypeSearch<T> ContentCategoriesFacet<TSource>(this ITypeSearch<T> search, int size = 10)

Control over edit mode API calls

Hello,

We have a complaint from a CMS editor who I think has a slower internet connection.

When they are assigning categories for a CategoryList property, using the editor modal, every time they expand a node (or parent category) it makes an API call for each individual child. I assume this is to determine if the category is selectable or not because the children are visible immediately but the checkboxes are not.

While we could maybe solve this by organizing our categories differently so that there are not too many children under a given parent, are there any settings we could use to control this?

Love the add-on and thank you for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.