Try our conversational search powered by Generative AI!

How to extend Url property to add extra option with choice of block (similar to Page option) CMS 12


Hi Guys,

I need to extand UrlProperty (CMS 12) to be able choose also Block (ContentReference). It should be localized between Page and Media options. I need it to navigate to specific section (in this case block) on the page and editor can choose which block on his own. I know that I should use EditorDescriptor and modify metadata. But all solutions I've found in forum are involved only CMS11 end extending the HyperLinkProperty ( not Url. Maybe somebody's done something like this and can help me?

Dec 23, 2022 8:21

What's the use case for this? Blocks do not have URLs, so adding a way to select a block in a Url property doesn't really make sense.

If you're hoping to link to a Url to show a block's content, you need to add the block to a page's ContentArea (or render it on the page in a similar fashion), then link to the page with the Url property.

Dec 23, 2022 19:41

Thanks for answer Chris. Yes, I know it. I will built the URL in the backand using chosen block ID as an anchor. My team want to select block (shared block) from Assets Panel by the same Url property. We can navigate to this block (for example automatically scroll down to this section/block). It will be more intuitive for content editor to choose it in the same Url selector instead of new property. I have done sth like this:

But the problem is: this code override all LinkItem/LinkItemCollection/Url properties (HyperLink is everything inside this Dialog). Is it possible to limit properties where I want to override links inside? I've tried to do it by UIHint but maybe in wrong way. Do you know how to do it?

Edited, Dec 27, 2022 7:33
* 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.