{"id":6945,"date":"2025-01-03T10:58:59","date_gmt":"2025-01-03T08:58:59","guid":{"rendered":"https:\/\/dox.fi\/?p=6945"},"modified":"2025-01-03T10:58:59","modified_gmt":"2025-01-03T08:58:59","slug":"new-method-to-find-empty-links","status":"publish","type":"post","link":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/","title":{"rendered":"New method to find empty links"},"content":{"rendered":"\n<p>A risk that the use of systems for structured authoring involves is that the targets for internal links are not included in all publications which include those links. You can avoid this if you condition these links with the same identifiers as their targets and if you make sure that their targets are always included in the same topic trees. This makes sure that they are always included in the same publications. Such details are easy to forget, though. When that happens, you must notice the empty links when you review those publications.<\/p>\n\n<p><a href=\"https:\/\/dox.fi\/en\/systems\/dox-cms\/\">DoX CMS<\/a> automatically adds the values for the targets of internal links inside them when it can find those targets. For example, when the same image is &#8216;image 1&#8217; in one publication but &#8216;image 5&#8217; in a different publication, the system includes the correct value inside these links in those publications. This only requires that you leave the text boxes for those links empty in the text editor.<\/p>\n\n<p>If a publication does not include an element for the link to target, however, the link will simply be left empty. Such empty links are hard to notice when you review publications.<\/p>\n\n<p>The solution to this is so obvious that I am ashamed for not having considered it before now. The implementation is similar to those that I proposed as part of a <a href=\"https:\/\/dox.fi\/en\/features-from-stylesheets-styles-for-previews-and-adaptive-titles\/\">separate style for previews<\/a>. However, all users of DoX CMS can add or adapt this solution as part of their default styles to make it easier to review publications.<\/p>\n\n<h2 class=\"wp-block-heading\">Solution<\/h2>\n\n<p>Simply put, the solution is to add content to empty link elements with the help of your style sheets. There are only three situations in which link elements remain empty:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>the publication lacks an internal link&#8217;s target,<\/li>\n\n\n\n<li>no anchor text was written in an external link&#8217;s text box, or<\/li>\n\n\n\n<li>you have left the field for element title format empty.<\/li>\n<\/ul>\n\n<p>The first two can be accommodated with warnings for them if you add this to your style sheets:<\/p>\n\n<pre class=\"wp-block-code\"><code>a:empty::after {content: \"Warning: link target not found\";}\n\na&#91;href^=\"https:\/\/\"]:empty::after {content: \"Warning: add anchor text to link\";}\n\na:empty::after {\n    color: red;\n    display: inline;\n    text-decoration: inherit;\n    text-transform: uppercase;\n}<\/code><\/pre>\n\n<p>This adds the values for the content rule inside empty links in a very visible way. The provided specifications make these added parts red with uppercase letters. I wrote them in English but you can replace those phrases with warnings best suited for you. However, I recommend against translating them to match publications&#8217; languages because they are designed to stand out when you review those publications.<\/p>\n\n<p>The first part adds a warning about a missing link target to all empty links. The second part replaces this default warning, when the link value starts with &#8216;https:\/\/&#8217;. This leaves the first alternative to only be used by internal links which do not find their targets.<\/p>\n\n<p>If you include external links that start with an identifier other than &#8216;https:\/\/&#8217;, you can also apply the same rule to them. To do so, you must separate copies of the original selector with commas and change the copies to use the alternative identifiers with which external links can start. Make sure to always include such identifiers at the starts of external links&#8217; values, especially if you make these additions to your style sheets.<\/p>\n\n<pre class=\"wp-block-code\"><code>a&#91;href^=\"https:\/\/\"]:empty::after,\na&#91;href^=\"www.\"]:empty::after \n{content: \"Warning: add anchor text to link\";}<\/code><\/pre>\n\n<p>This solution does not designate links to which you wrote anchor texts in the text editor but which cannot find their targets.<\/p>\n\n<p>The third situation would involve the same formulation as my proposed solution to the first situation but you should change the used phrase to reflect this difference. If you leave the element title format field empty, you thus cannot use this solution to find links which cannot find their targets inside a publication. I recommend almost without exception that you include a title format for elements, and this is not the only related reason.<\/p>\n\n<p>Remember that you can use the option to find in content when you review publications, and use these phrases as your search terms. This lets you find the positions of all such warnings easily and quickly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A risk that the use of systems for structured authoring involves is that the targets for internal links are not included in all publications which include those links. You can avoid this if you condition these &#8230; <a title=\"New method to find empty links\" class=\"read-more\" href=\"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/\" aria-label=\"Read more about New method to find empty links\">Read More<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[49,69,48,337,114,28,129],"class_list":["post-6945","post","type-post","status-publish","format-standard","hentry","category-news-archive","tag-cms-en","tag-css-en","tag-dox-en","tag-solution","tag-structured-authoring","tag-structured-writing","tag-stylesheet","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>New method to find empty links - DoX Systems<\/title>\n<meta name=\"description\" content=\"A solution to find empty links that either lost their targets through structured authoring or lack a text anchor.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New method to find empty links - DoX Systems\" \/>\n<meta property=\"og:description\" content=\"A solution to find empty links that either lost their targets through structured authoring or lack a text anchor.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/\" \/>\n<meta property=\"og:site_name\" content=\"DoX Systems\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-03T08:58:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dox.fi\/wp-content\/uploads\/2021\/08\/mg-9260-low-res.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1090\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sami Rissanen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sami Rissanen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/\"},\"author\":{\"name\":\"Sami Rissanen\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/person\\\/a83ff87cfa6da8c9e8d4c0943d6f5e3c\"},\"headline\":\"New method to find empty links\",\"datePublished\":\"2025-01-03T08:58:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/\"},\"wordCount\":658,\"publisher\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#organization\"},\"keywords\":[\"CMS\",\"CSS\",\"DoX\",\"solution\",\"structured authoring\",\"structured writing\",\"stylesheet\"],\"articleSection\":[\"News\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/\",\"url\":\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/\",\"name\":\"New method to find empty links - DoX Systems\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#website\"},\"datePublished\":\"2025-01-03T08:58:59+00:00\",\"description\":\"A solution to find empty links that either lost their targets through structured authoring or lack a text anchor.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dox.fi\\\/en\\\/new-method-to-find-empty-links\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dox.fi\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New method to find empty links\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#website\",\"url\":\"https:\\\/\\\/dox.fi\\\/\",\"name\":\"DoX Systems\",\"description\":\"KUSTANNUSTEHOKKAAT JA MODERNIT J\u00c4RJESTELM\u00c4T TEKNISEN DOKUMENTOINNIN JA VARAOSALIIKETOIMINNAN TARPEISIIN\",\"publisher\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dox.fi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#organization\",\"name\":\"DoX systems\",\"url\":\"https:\\\/\\\/dox.fi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/favicon.png\",\"contentUrl\":\"https:\\\/\\\/dox.fi\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/favicon.png\",\"width\":512,\"height\":512,\"caption\":\"DoX systems\"},\"image\":{\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/dox.fi\\\/#\\\/schema\\\/person\\\/a83ff87cfa6da8c9e8d4c0943d6f5e3c\",\"name\":\"Sami Rissanen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g\",\"caption\":\"Sami Rissanen\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New method to find empty links - DoX Systems","description":"A solution to find empty links that either lost their targets through structured authoring or lack a text anchor.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/","og_locale":"en_GB","og_type":"article","og_title":"New method to find empty links - DoX Systems","og_description":"A solution to find empty links that either lost their targets through structured authoring or lack a text anchor.","og_url":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/","og_site_name":"DoX Systems","article_published_time":"2025-01-03T08:58:59+00:00","og_image":[{"width":1920,"height":1090,"url":"https:\/\/dox.fi\/wp-content\/uploads\/2021\/08\/mg-9260-low-res.jpg","type":"image\/jpeg"}],"author":"Sami Rissanen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sami Rissanen","Estimated reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/#article","isPartOf":{"@id":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/"},"author":{"name":"Sami Rissanen","@id":"https:\/\/dox.fi\/#\/schema\/person\/a83ff87cfa6da8c9e8d4c0943d6f5e3c"},"headline":"New method to find empty links","datePublished":"2025-01-03T08:58:59+00:00","mainEntityOfPage":{"@id":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/"},"wordCount":658,"publisher":{"@id":"https:\/\/dox.fi\/#organization"},"keywords":["CMS","CSS","DoX","solution","structured authoring","structured writing","stylesheet"],"articleSection":["News"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/","url":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/","name":"New method to find empty links - DoX Systems","isPartOf":{"@id":"https:\/\/dox.fi\/#website"},"datePublished":"2025-01-03T08:58:59+00:00","description":"A solution to find empty links that either lost their targets through structured authoring or lack a text anchor.","breadcrumb":{"@id":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dox.fi\/en\/new-method-to-find-empty-links\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dox.fi\/en\/"},{"@type":"ListItem","position":2,"name":"New method to find empty links"}]},{"@type":"WebSite","@id":"https:\/\/dox.fi\/#website","url":"https:\/\/dox.fi\/","name":"DoX Systems","description":"KUSTANNUSTEHOKKAAT JA MODERNIT J\u00c4RJESTELM\u00c4T TEKNISEN DOKUMENTOINNIN JA VARAOSALIIKETOIMINNAN TARPEISIIN","publisher":{"@id":"https:\/\/dox.fi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dox.fi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/dox.fi\/#organization","name":"DoX systems","url":"https:\/\/dox.fi\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/dox.fi\/#\/schema\/logo\/image\/","url":"https:\/\/dox.fi\/wp-content\/uploads\/2019\/10\/favicon.png","contentUrl":"https:\/\/dox.fi\/wp-content\/uploads\/2019\/10\/favicon.png","width":512,"height":512,"caption":"DoX systems"},"image":{"@id":"https:\/\/dox.fi\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dox.fi\/#\/schema\/person\/a83ff87cfa6da8c9e8d4c0943d6f5e3c","name":"Sami Rissanen","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63d62c72a49d739fc7b816fd11fdf38a0bc362f94304a5b74cafe4eabc90e408?s=96&d=mm&r=g","caption":"Sami Rissanen"}}]}},"_links":{"self":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts\/6945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/comments?post=6945"}],"version-history":[{"count":1,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts\/6945\/revisions"}],"predecessor-version":[{"id":6946,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/posts\/6945\/revisions\/6946"}],"wp:attachment":[{"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/media?parent=6945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/categories?post=6945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dox.fi\/en\/wp-json\/wp\/v2\/tags?post=6945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}