1

I'm a bit stumped. For some reason Drupal prints some extra links and I can't find where are they generated.

This is what I see in my output: screenshot generated code

The arrows point to the extra ocurrences of <a href="/areaclientes"></a>

The template code for this page is like this:

<div id="wrapper" class="clearfix">
<div id="header-top" class="clearfix">
<div id="logo"><!--start logo-->
<?php if ($logo): ?>
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>">
<img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
</a>
<?php endif; ?>
<div id="site-slogan"><?php if ($site_slogan): ?><?php print $site_slogan; ?><?php endif; ?></div><!--site slogan-->
</div><!--end logo-->
 <?php if ($page['search_box']): ?><!-- / start search box region -->
    <div class="search-box">
      <?php print render($page['search_box']); ?>
    </div> <!-- / end search box region -->
 <?php endif; ?>
 <?php if (theme_get_setting('social_icons')): ?>
<ul id="header-social">
<li><a href="http://www.twitter.com/<?php echo theme_get_setting('twitter_username'); ?>" target="_blank" rel="me"><img src="<?php global $base_url; echo $base_url.'/'.$directory; ?>/images/twitter.png" alt="twitter"/></a></li>
<li><a href="http://www.facebook.com/<?php echo theme_get_setting('facebook_username'); ?>" target="_blank" rel="me"><img src="<?php global $base_url; echo $base_url.'/'.$directory; ?>/images/facebook.png" alt="facebook"/></a></li>
<li><a href="<?php print $front_page . ($language->prefix ? '/' : ''); ?>rss.xml"><img src="<?php global $base_url; echo $base_url.'/'.$directory; ?>/images/rss.png" alt="RSS"/></a></li>
</ul><!--end header-social-->
<?php endif; ?>
</div><!--end header-top-->

<div id="header" class="clearfix"><!--start header--> 
    <?php print render($page['header']); ?>
<div id="main-menu">
    <?php 
    $main_menu_tree = menu_tree(variable_get('menu_main_links_source', 'main-menu')); 
    print drupal_render($main_menu_tree);
    ?>
</div><!-- end main-menu -->
</div>

I've been looking all over the place, and can't find WHERE is that coming from. Searching in site's source code I only found 1 instance of a similar looking URL, inside a Module I disabled and deleted from the host; and still the same thing.

The links appear both before the main menu starts building, and after. Several times for the first menu item, but never again. And it only happens with anonymous users, never with logged in users...

Any pointers in where should I be looking to fix this?

Thanks a lot in advance.

Edit:

I found that the problem lies in this piece of code:

<div class="search-box">
        <div id="link-clientes"><a href="/areaclientes">ÁREA DE CLIENTES <img height="14" width="14" src="/sites/default/files/pictures/clipart/key.png"</a></div>
      <?php print render($page['search_box']); ?>
    </div> <!-- / end search box region -->

If I remove the #link-clientes <div>; the ghost links stop appearing later on. Still don't understand why.

  • Did you clear the cache after disabling the other module and / or changing your theme file? It might be that there are still traces in the cached pages. – Neograph734 Oct 18 '13 at 11:18
  • 1
    Yup, cache cleared. Just in case I'm going nuts I emptied again and tried from a different computer, same result. – nardus Oct 18 '13 at 11:24
1

It can't be that hard to understand. There's a syntax error:

<div id="link-clientes"><a href="/areaclientes">ÁREA DE CLIENTES <img height="14" width="14" src="/sites/default/files/pictures/clipart/key.png"</a></div>

<img> tag is not closed. That's breaking your whole page HTML structure/well formedness.

  • It's not now that you pointed it out. I was going over and over that code and failed to see that... Sorry, and thanks! – nardus Oct 18 '13 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.