Schema y Microdata: ¿Cómo agregar campo content= e itemid= en archivo .tpl.php?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by elpoderosoperu on February 11, 2016 at 4:57pm

Hola

Estoy añadiendo a mano Schema y Microdata a mi sitio web pero me topo con dos problemas:

1- Quiero reproducir la url de mis imágenes en slideshow.tpl.php. Sólo me falta incluir en content= la url de mi primera imagen cómo se muestra abajo:

Intenté con estos códigos php pero sin éxito:

<?php
print render($content['field_image']);
?>
<?php
echo render(file_create_url($node->field_image['und'][0]['uri']));
?>

2- También quiero reproducir la url de mi página en itemid= como señala el ejemplo inferior

Agradezco su ayuda.

Categories: , ,

Comments

Puedes probar el modulo Image

Posted by jsalinasd on February 18, 2016 at 2:34pm

Puedes probar el modulo Image URL Formatter para obtener solo la URL de la imagen de una forma un poco más simple:

https://www.drupal.org/project/image_url_formatter

Luego de instalarlo configuras el formatter del campo como Image URL (o algo similar).

proba con este codigo

Posted by leofishman on February 24, 2016 at 8:18pm
<?php


$estilo
= array(
'type' => 'image',
'settings' => array(
'image_style' => 'medium',
'image_link' => 'content',
),
);
$thumb_images = field_get_items('node', $node, 'field_gallery_images');
$imagen = field_view_value('node', $node, 'field_gallery_images', $thumb_images[0],$estilo);
print
drupal_render($imagen);

?>

Argentina

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /