How to allow Catalog to be drag as a link

Vote:
 

We are using Catalog node as our product listing page. Created controller and it works perfectly. Now we want to allow the editor to drag and drop the catalog node into a property of the type of Url (or ContentReference). The problem we have is it doesn't allow the user to drag and drop catalog into the field. Any can help us to see why it is not allowed and is there any way we can allow user for doing this.

Regards,

Aria

#201338
Feb 15, 2019 1:43
Vote:
 

Hi,

I still can drag and drop the catalog node into a conten reference/Url property without AllowTypes setting as well. So did you have any AllowTypes setting for your property or did you get any javascript problems when dragging and dropping Catalog node?

#201339
Feb 15, 2019 2:29
Vote:
 

I'm not sure what the problem is, can't you use

[AllowedTypes(typeof(CatalogContent), typeof(NodeContent)]

attribute on your property?

#201343
Feb 15, 2019 8:57
Vote:
 

Thanx all. I think I described it wrong. We want to drag and drop instance of catalogcontent( direct node after catalog root) and that is not possible to drag and drop instance of CatalogContent to url  field. 

#201349
Feb 15, 2019 11:35
Vote:
 

Can you post a screenshot and a code snippet, I still don't grasp it 

#201350
Feb 15, 2019 12:33
Vote:
 

Let me give you a better picture of what is happening. Our catalog structure is as below:

And we are using CatalogContent (in above example 'AU Region') as our product listing page (means CatalogContent has a correspondent controller)

    public class CatalogContentController : ActionControllerBase, IRenderTemplate<CatalogContent>, IRenderTemplate<SampleCategoryNode>
    {

        public ActionResult Index(NodeContentBase currentContent) {
         ....
       }
    }

Routing and showing the product listing working perfectly. Now we need to setup our website menu structure, that means I need to drag our CatalogContent instance (in our example 'AU Region') into a Url field. But CMS does not allow me to do that:

And as you can see on 'Url' field we CAN'T drop the 'AU Region'!! I'm just curious to know as 'AU Region' has valid url (has controller and routing working perfectly with it) why we can't select CatalogContent instance on our URL field (type of URL field is Episerver Url).

Regards,

Aria

#201380
Feb 16, 2019 23:14
Vote:
 

How do you define the Url property in code?

#201382
Feb 17, 2019 8:53
Vote:
 
        [CultureSpecific]
        [Display(
            Name = "Url",
            GroupName = SystemTabNames.Content,
            Order = 20)]
        public virtual Url Url { get; set; }

;)

#201383
Edited, Feb 17, 2019 9:15
Vote:
 

I'm less familiar with Url, but is there a reason you didn't use ContentReference?

#201384
Feb 17, 2019 23:41
Vote:
 

So user can provide external Url if needed :) But even with ContentReference, CMS does not allow to drag a Catalog to the property that is type of ContentReference

#201385
Feb 18, 2019 0:27
Vote:
 

I can confirm that it works well on Quicksilver - so it's probably something with your site. In this case, you would have to contact our developer support for further assistance 

#201392
Feb 18, 2019 10:58
Vote:
 

appreciate it mate :) 

#201399
Feb 18, 2019 12:25
Vote:
 

Hi Aria,

Did you manage to solve this? I'm facing the exact same issue.

Kind regards

Bart

#206817
Aug 30, 2019 12:09
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.