Actions

Joomla 2.5 com content generates non-valid xhtml

From Joomla! Documentation

Revision as of 09:19, 11 February 2013 by Wilsonge (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Joomla 2.5 content component generates non-valid xhtml if an article has empty parameters: Link A, Link B, Link C.

The problem is located in this file: components\com_content\views\article\tmpl\default_links.php

For fixing the issue apply the next patch:

Index: components/com_content/views/article/tmpl/default_links.php
===================================================================
--- components/com_content/views/article/tmpl/default_links.php (revision 22800)
+++ components/com_content/views/article/tmpl/default_links.php (working copy)
@@ -12,11 +12,11 @@
 
 // Create shortcuts to some parameters.
 $params                = $this->item->params;
+if ($urls AND (!empty($urls->urla) OR !empty($urls->urlb) OR !empty($urls->urlc))) :
 ?>
 <div class="content-links">
        <ul>
                <?php
-               if ($urls) :
                        $urlarray = array(
                        array($urls->urla, $urls->urlatext, $urls->targeta, 'a'),
                        array($urls->urlb, $urls->urlbtext, $urls->targetb, 'b'),
@@ -73,5 +73,5 @@
                                </li>
                <?php endforeach; ?>
        </ul>
-       <?php endif; ?>
 </div>
+<?php endif; ?>
  • + means line added
  • - means line removed

See also