Link to category/product in Editor (ckeditor)

I was going to demo how to add links to categories and products in the editor. But all I got to pick was pages. It doesnt seem possible to link to categories or products in any way which I find hard to believe. How is it supposed to work?

Litium version: 7.4

I don’t believe the CKEditor has ever supported product and category links, only pages (and media). For some quick research, I tested in every major version since 4.8 and it’s not available.

I see. Unfortunately that renders the editor kind of useless. I’d be happy to build it myself though. Any pointers in how to access the link dialog as the page select is currently doing? I don’t see it in the “config” object passed to ckeditor by Litium.

You can add a button to the toolbar, which opens a dialog on clicked: https://ckeditor.com/docs/ckeditor4/latest/guide/plugin_sdk_sample_1.html

Then the dialog’s content should be an iframe to select a product: https://docs.litium.com/documentation/architecture/back-office_1/select-dialog_1

There is a file which parses the stored id into actual URL, I remember its name is LinkParser.ashx or something similar.

The extra dialog tabs are added in the globalConfig.js file as an event listener for the dialogDefinition event that CkEditor is fire.

I’m trying to use the product select dialog but it throws an error when I click “OK”:

GET http://localhost/Litium/app/api/null/products/8b33b763-43b5-4c7e-b37d-b0adb50baf91 404 (Not Found)

I think the “null” part in the URL should be “pim”, right? What is causing this?

And is there a dialog to select a category?

“products” entity type seems to refer to base products. Since 7.4 lists have the base product/variant switch. Any plan on adding that to this dialog?

No there is no plan for it. Have you tried ‘baseProductsAndVariants’?

Please, add an idea about your needs.

‘baseProductsAndVariants’ doesn’t work, as according to the documentation only Angluar dialogs are supported by EntitySelectorWrapper. baseProductsAndVariants is AngularJS.

What’s kind of disappointing though is that it looks like the code in EntityTreeSelector supports selecting a category, but EntityTreeSelectorWrapper doesn’t take any input and seems hardcoded to only support pages for no apparent reason.

I’ll report the dialog issue as a bug.

Both 2 issues were fixed in 7.4.1.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.