Developer Forum »
Links to internal content in rich text editor
36 posts

Hi devs!

I have following problem: in one of the content classes I have HTML property, which holds a piece of text with links. The links are created with Webnodes GUI, chosen type is "Local webpage". Then from a search box an existing page is selected. The URL in the link in the rendered HTML is correct. However if I change now the "address" option of that referenced page the link in the HTML property contains old URL. What is also strange that the link changed its type to "Local special address". Isn't there a built-in mechanism that just keeps pointers to the content and generates such URLs when rendering the page? This would eliminate hardcoded URLs in an HTML property, and also no need to update them each time an "address" of existing content is changed.

Cheers,

181 posts

Hi!

The links in an html property are re-evaluated each time it is rendered, so it should pick up any changes you make to the address of the destination page. I just tested in the basic demo site upgraded to the latest Webnodes version.

When you add the link in the editor, the link is in the format of "/basicdemo/about-us".

When you save that node, it is replaced with a url like this: "/basicdemo/?nid=135".

When you render that page, the link is re-evaluated, uses the friendly address of the node being linked to. If you change the node being linked to, the link should be changed as well, the next time it is rendered. 

In my tests it all works as expected, in both Chrome and IE. I'm not able to reproduce that it changes to "Local specialized address".

If it still doesn't work as expected for you, try to upgrade to the latest version of Webnodes if that helps.

36 posts

Hi Vidar!

Can try also with an MVC installation? I tested on a fresh empty MVC installation and could reproduce the issue, however after a couple of changes, cache clearing and "rebuild link index" I cannot reproduce thsi anymore. Maybe you can find a pattern.

Thanks!

181 posts

Hi!

I just tried with an MVC installation, and I was able to reproduce the issue, but I'm not 100% sure what the problem is yet. It has something to do with the routing done in the individual template. I have a route defined like this:

routes.MapRoute(
    "FriendlyUrl",
    "{name}",
     new { controller = "FriendlyUrl", action = "Index", name = UrlParameter.Optional }
 );  

 

That works exactly as expected, and similar to Webforms. Some other routes with a traditional {controller}/{action} format, the issue is simple to reproduce. 

We'll investigate further. I'll let you know as soon as we've found the base problem, and the solution.

 

1