How to theme views fields template to display a gallery? My question is generic because the solution will allow me to use various jquery gallery as bxslider, galleria or flexslider.
My need is about creating a gallery with thumbnail nav, for that I need to create a views display that provide this kind of code (ex from bxlsider):

&lt;ul class="bxslider"&gt;
  &lt;li&gt;&lt;img src="/images/730_200/tree_root.jpg" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;img src="/images/730_200/houses.jpg" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;img src="/images/730_200/hill_fence.jpg" /&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div id="bx-pager"&gt;
  &lt;a data-slide-index="0" href=""&gt;&lt;img src="/images/thumbs/tree_root.jpg" /&gt;&lt;/a&gt;
  &lt;a data-slide-index="1" href=""&gt;&lt;img src="/images/thumbs/houses.jpg" /&gt;&lt;/a&gt;
  &lt;a data-slide-index="2" href=""&gt;&lt;img src="/images/thumbs/hill_fence.jpg" /&gt;&lt;/a&gt;
&lt;/div&gt;


The list creation is easy for mu but I don't find a way to produce the thumbnail part..the views PHP module seem to be the path (to add data attributes and create the thumbnail "list") but I don't find the right way.

If someone can help me.All of this come from that actually using Drupal 6. :/

Thanks

EDIT: use case with data from $row views object.I don't know how to print field data settings in my view as in the template to override the output.
Here I would to add the "data-thumb" attribute dynamically, provided by views data.

&lt;ul class="slides"&gt;
    &lt;li data-thumb="slide1-thumb.jpg"&gt;
      &lt;img src="slide1.jpg" /&gt;
    &lt;/li&gt;
    &lt;li data-thumb="slide2-thumb.jpg"&gt;
      &lt;img src="slide2.jpg" /&gt;
    &lt;/li&gt;
    &lt;li data-thumb="slide3-thumb.jpg"&gt;
      &lt;img src="slide3.jpg" /&gt;
    &lt;/li&gt;
    &lt;li data-thumb="slide4-thumb.jpg"&gt;
      &lt;img src="slide4.jpg" /&gt;
    &lt;/li&gt;


No difficulty to build the list in views.

EDIT2: back on my second example, I improve my code and I'm near the goal.In a views field tpl I put actually:

&lt;?php 

    $imgurl = file_create_url($field-&gt;uri);  
    $img_filepath = $fields['filepath']-&gt;content;
    $img_slide_size = $fields['field_galerie_image_vdl_fid']-&gt;content;
    $img_caption = $fields['field_galerie_image_vdl_data']-&gt;content;
    print '&lt;li data-thumb='.$img_filepath.'&gt;&lt;img src="'.$img_slide_size.'" /&gt;'
            . '&lt;p&gt;'.$img_caption.'&lt;/p&gt;'
            . '&lt;/li&gt;';

?&gt;


Naturally when it'll be ok, a foreach loop will needed.But I need to clean the provided views code, because actually I put off all HTML things via the Views UI but I think it's possible to that by PHP code.

EDIT 3: my new base code to continue looking for theming my views output from unformatted content.

&lt;ul class="bxslider"&gt;
&lt;?php foreach ($fields as $id =&gt; $field): ?&gt;
  &lt;?php if (!empty($field-&gt;separator)): ?&gt;
    &lt;?php print $field-&gt;separator; ?&gt;
  &lt;?php endif; ?&gt;

  &lt;?php print $field-&gt;wrapper_prefix; ?&gt;
    &lt;?php print $field-&gt;label_html; ?&gt;
&lt;!-- TEMPLATE DE VIEWS FIELDS CUSTOM BX SLIDER --&gt;
&lt;?php 
//création des variables utiles pour la mise en forme de la sortie de la vue
  $imgurl = file_create_url($field-&gt;uri);  

    $img_thumb_filepath = strip_tags($fields['field_galerie_image_vdl_fid_1_value']-&gt;content);
    $img_slide_size = strip_tags($fields['field_galerie_image_vdl_fid_value']-&gt;content);
    $img_caption = strip_tags($fields['field_galerie_image_vdl_data_value']-&gt;content);
    $img_delta = strip_tags($fields['delta']-&gt;content);
    ?&gt;


 &lt;?php
               foreach ($fields as $key =&gt; $lien) {

                    print '&lt;li&gt;'.$img_slide_size.'&lt;/li&gt;';
               }
      ?&gt; 

  &lt;?php print $field-&gt;wrapper_suffix; ?&gt;
&lt;?php endforeach; ?&gt;
&lt;/ul&gt;


actually my variables doesn't return the right content, but I don't know how to find the right syntax.
I would recommend going via Views Templates, take a look at views-view-fields.tpl.php template. From there you should be able to duplicate and modify the views content for the thumbnail part.