1

I'm back on this issue for me because I would to implement Responsive slideshows with thumbnails and many of those use 2 elements to display thumbs and full image. So I know I need to edit the style output template or the row style output template but I don't know how to find values provided by views to print them inside my template. This doesn't explain how to find variables. I'm looking for some example and explanations to understand how to do.

So I get the style output template, and I have done as you said to print fields. I want to modify the field settings in the view.

<?php if (!empty($title)): ?>
  <h3><?php print $title; ?></h3>
<?php endif; ?>
  <!-- Construction de la liste -->
  <ul class="bxslider">
<?php foreach ($rows as $id => $row): ?>
  <li class="<?php print $classes[$id]; ?>">
    <?php print $row; ?>
  </li>
<?php endforeach; ?>
</ul>
  <div id="bx-pager">
      <?php foreach ($rows as $id => $row): ?>

    <?php print ($fields['field_galerie_image_vdl_fid_1']->content); ?>

<?php endforeach; ?>
</div>

I can't find the right targeting for my desired field, and in the I need to exclude some part of the output.

2
  • RWD slideshows what's that? what does the R, W, and D stand for?
    – No Sssweat
    Jul 7, 2016 at 8:13
  • Responsive slideshow, sorry.
    – user8753
    Jul 7, 2016 at 8:20

1 Answer 1

1

Under Advanced, Theming: Information, click on Information and you will see something like this:

enter image description here

For template file name you want to use the last suggested name, (which I underlined for you) that way it only affects this specific view and not others.

In the above example Row Style Output: you would use views-view--fields-shipping-cart--block.tpl.php

To print your fields, inside the template file you put

<div class="example1"><?php print $fields["title"]->content; ?></div>
<div class="example2"><?php print $fields["field_name"]->content; ?></div>

Title prints your node title, else if you want to print a field, you use field_name

Remember to flush the cache to see changes or you could click the Rescan template files button

If you're unsure of the name of a field, In view's click on your field, and go to re-write the output of the field, click on replacement patterns, whatever name replacement patterns uses is the one you need to use.

Alternatively, instead of working with template files, you could work with just replacement patterns if you like as my answer shows here

Else if you just want to add classes to your fields, you can do it with views like this:

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.