A question that often shows up in the newsgroup is the fact that in some situations links that MCMS should treat as internal managed links are saved as unmanaged external links. The problem with unmanaged external links is that in case you move the destination posting to a different location the link will no longer work.
The easiest way to identify if a link is stored as external or internal link is to switch between unpublished mode and published mode and check if the link changes.
What are actually reasons why MCMS would store a link as external link and not as internal link? Well, the reason is: This will happen in all situations where MCMS is not able to identify that the link is pointing to another posting.
Here are the most common reasons for this:
- The link is not embedded between quotes.
MCMS assumes that all links stored in HtmlPlaceholder and XmlPlaceholder objects are embedded in quotes. If the link is stored without quotes then the link parser will not see the link and the link is stored together with the other elements as static text. Usually this affects custom placeholder controls for XmlPlaceholders.
To get the link stored as managed link the link has to be stored in one of the following formats:
<link url=”/MyChannel/MyPosting.htm” />
- ManageCmsUrls of an XmlPlaceholder definition is set to false
This is an obvious one but I need to add it to ensure that all reasons are listed.
- The link is pointing to items with non-unique path elements
The parser analyzing the URL might end up at the wrong object and might not find the item in the respository (similar problem as with GetByPath). Then the link is stored as unmanaged link and not as managed link which will cause problems when the site structure is changed (e.g. moving postings to other channels).
/AAA <— Posting or Channel
/AAA <— Channel
/B <— Posting
A link to posting B might be stored as unmanaged link if the algorithm analyzing the URL (/AAA/B) first finds the posting AAA and not the channel AAA).
To avoid this: ensure that on the same level there are no name conflicts between different channels or postings.
Also be aware that you would only get very limited support from Microsoft in case that problems occur due to the fact that items with duplicate path exist.
- Link is pointing to an item in a different site
When the “map channel name to host header name” feature is enabled in the SCA, then different root channels identify different sites. It is still possible to add a link to posting in a different site using web author dialog but actually the algorithm analyzing the URL does not honor the host name in the link – which actually identifies the root channel. So what happens is that the parser checks if the URL is valid in the current site and if yes it adds the link to the item in the current site rather than the desired item. If the item is not a valid link to an item in the current site the link is stored as unmanaged link.
Here is an example:
If you add a link to http://www.siteB.com/A.htm to a posting in site www.siteA.com then the link being stored in the placeholder will actually be a managed link pointing to http://www.siteA.com/A.htm – ugly but true.
This behaviour is by design.
- The link contains a query string
By design MCMS is not able to store links with query strings as managed links.
- If non of the above applies to your system…
…then it might be a bug in MCMS or a database inconsistancy and you should open a support case to get this analyzed.
One known bug which only affects non-administrator users is listed here:
KB 831358 – Internal links that are created by users who are not administrators become static