When i wrap a media render with a link (link to node) the html is broken.
For exampe i show the html output from search result (search api), but it happens also in views or other output, when i write <a href="xxxx">[field_media]</a>
the output is rewritted and duplicates the "<a" in each div inside the media html tree

<div class="node-render">
<a href="/1/1258103644/actualidad/baja-el-impuesto-de-matriculacion-de-las-motos"/>
<div id="node-179" class="node node-article contextual-links-region view-mode-search_result" about="/1/1258103644/actualidad/baja-el-impuesto-de-matriculacion-de-las-motos" typeof="sioc:Item foaf:Document">
<a href="/1/1258103644/actualidad/baja-el-impuesto-de-matriculacion-de-las-motos"/>
<div class="media">
<a href="/1/1258103644/actualidad/baja-el-impuesto-de-matriculacion-de-las-motos"/>
<div id="file-424" class="file file-image file-image-jpeg contextual-links-region">
<a href="/1/1258103644/actualidad/baja-el-impuesto-de-matriculacion-de-las-motos"/>
<h2 class="element-invisible">
<div class="contextual-links-wrapper contextual-links-processed">
<div class="content">
</div>
</div>
<h3>¡Baja el impuesto de matriculación de las motos!</h3>
<div class="autor">13.11.2009 | Actualidad</div>
<div>
<div class="clearfix"/>
</div>
</div>
<div class="node-render">
<a href="/1/1237912198/actualidad/segundo-combate-co2-gobierno-2-0-motos">
<div id="node-2984" class="node node-article contextual-links-region view-mode-search_result" about="/1/1237912198/actualidad/segundo-combate-co2-gobierno-2-0-motos" typeof="sioc:Item foaf:Document">
<div class="media"/>
<h3>Segundo combate CO2: Gobierno 2-0 Motos</h3>
<div class="autor">24.03.2009 | Actualidad</div>
<div>
<div class="clearfix"/>
</div>
</a>
</div>

Comments

egarias’s picture

Issue summary:View changes

additional info

egarias’s picture

Issue summary:View changes

correction

egarias’s picture

Issue summary:View changes

trying to write plain text format

egarias’s picture

Issue summary:View changes

second try

egarias’s picture

More info:

in my tpl.php i cannot do this:

<article class="node-<?php print $node->nid; ?> <?php print $classes; ?> "<?php print $attributes; ?>>
<a href="<?php print $node_url; ?>">
<?php print render($content['field_media']);  ?>
<div class="inside">
   
    <div class="content">
   <h3<?php print $title_attributes; ?>><?php print $title; ?></h3>
      <?php print render($content['field_subtitulo']);  ?>
    </div>
</a>
</div>
</a>
</article><!-- /.node -->

Because the html gets broken with multiple <a href="<?php print $node_url; ?>"> in all the media hierarchy
I have to do this

<article class="node-<?php print $node->nid; ?> <?php print $classes; ?> "<?php print $attributes; ?>>

<?php print render($content['field_media']);  ?>
<div class="inside">
    <a href="<?php print $node_url; ?>">
    <div class="content">
   <h3<?php print $title_attributes; ?>><?php print $title; ?></h3>
      <?php print render($content['field_subtitulo']);  ?>
    </div>
</a>
</div>

</article><!-- /.node -->

So I have to modify all the tpls, and the image cannot be linked

egarias’s picture

Nobody had this issue?
what i am doing wrong??
Please help

willyk’s picture

Did you manage to resolve this issue? If not, I can likely guide you to a solution if I get some more info from you.

RedEight’s picture

Someone else was having this problem over in #2077875: Updating makes views rewrite links format incorrectly (images no longer linkable via views). I'm still trying to figure out where it is adding all these <a> tags... it looks like it just traverses the tree and adds it to every single item...

UPDATE:
I found a "fix". Seems like the problem is with the file entity module. #1858036: File entity views fields outputting as a link are broken

Devin Carlson’s picture

Status:Active» Closed (duplicate)
Devin Carlson’s picture

Issue summary:View changes

third