This article outlines a practical suggestion for preventing errors by keeping the order of publishing and referencing pages in mind when staging. Following the suggestion will help prevent broken links from appearing when publishing content that links to a given page after that new page has been published.
Oftentimes, when updating a staging site, multiple changes are made simultaneously, involving the creation of new pages and referencing them in the content right away. While in most cases referencing new entities in content before publishing them is fine (usually the process publishes the referenced entity automatically), there are some cases in which it can lead to broken links upon publication. This happens due to the nature of staging; when linking to a newly created page before that new page has been published.
When creating content that references a newly created page, make sure to publish the newly created page before or at the same time as the content that it is referencing.
In remote staging, when content is published that references an unpublished page, it is given a “pseudo-link” which operates as a placeholder until that page is published. This means that if you link to a newly created page without publishing that page, the published link URL will be incorrect. Please review the steps below to avoid having issues with pseudo-links.
Steps to Reproduce
- Create a new page in staging.
- Create a web content structure and template that has a "Link to page" field.
- Create a web content article and select the new page in its field.
- Publish staging to live without selecting the new page.
- Check the article on live: its link should be empty since the page is not published.
- Publish staging to live and also select the new page.
- Verify the changes on live.
The article's link to page field is still empty.
If the referenced article was published before the page, the article must be published again. This can easily be done by editing it again or by changing the "Date Range" option in the publish configuration to include the necessary article.