Sharing blocks across multiple sites issue

Vote:
 

We are hosting three websites in EpiServer CMS.

Each site has a page we wish to link to in the same relative position.

We are sharing a block amongst all three sites with an XHTMLString control on it. In the XHtmlString we have a link which points to the page for that site.

The trouble is that if we go to another site and hit the link in the shared block it will direct to the other site where the link was set up.

Is there any mechanism in EpiServer to use an XHtmlString with a link and have that link point to the relative page under each site? We are trying not to create three blocks, one for each site. Is there another way to do this without blocks? Unfortunately the link is surrounded by content so an XHtmlString is the best option for us.

I'd appreciate any ideas.

Thank you

#181591
Aug 24, 2017 16:55
Vote:
 

Is the link pointing to the page that exists only in that target site?

#181592
Aug 24, 2017 23:20
Vote:
 

It is...and I know that is the problem. I was wondering if an XhtmlString link could point to a relative url under the site for all sites in our solution. All sites will have separate copies of the page but with the same relative location in all sites.

#181640
Aug 25, 2017 13:57
Vote:
 

I think that's by design - to point to reference of the page instead of the address of the page. this makes it possible to survive page movements in the tree - address of the link changes as well.

#181643
Aug 25, 2017 14:20
Vote:
 

Hi, the problem I assume is that XhtmlString on publish changes the url

from:

~/some/url/

to:

/EPiServer/CMS/Content/some/url/,,5532/?epieditmode=False

and there for makes it point to the item 5532 on that site.

I haven't found any solution for that...

And if you then use the XhtmlString out of http context, for example email, its changing to /link/someguid.aspx

Im interested in solving this one... =)

#181644
Aug 25, 2017 14:25
Vote:
 

I've not tried it on recent versions but I wrote about how to automatically convert external links into internal ones automatically some time ago for Episerver 5:

https://www.david-tec.com/2010/04/Automatically-convert-external-links-to-the-current-site-into-internal-links/

I know automatically converting external to internal links was added in Episerver 7 or 8 if memory serves me right. There may be a way of using what I previously wrote to reverse the built in logic and make internal links relative (it would be nice to selectively apply this though as you would not want this applied to all links in the rich text editor!).

David

#181661
Aug 26, 2017 16:39
* 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.