Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: mehrere Artikelbilder in Kategorie Listing - product_listing_include.html

    Knut

    • Neu im Forum
    • Beiträge: 27
    Hallo community
    ich würde gerne wie in der product_info_v1.html mehrere Bilder auch schon in der Kategorie Übersicht / Artikel Auflistung einbauen.
    Habe das aktuelle Shop-Release und nutze das Template tpl_modified
    ich vermute, die Datei ist:
    product_listing_include.html
    doch wie kann ich auf die "more images" Variablen von der product_info_v1.html verweisen?
    es würde schon reichen, wenn die 3 Bilder unter dem hauptbild in klein / ohne javascript funktionen ausgegeben werden

    es müsste ja hier in dem div class="lb_image" rein
    Code: PHP  [Auswählen]
    {if (!isset($STARTPAGE) && $smarty.const.PRODUCT_LIST_BOX == 'true') || ($STARTPAGE == 'true' && $smarty.const.PRODUCT_LIST_BOX_STARTPAGE == 'true')}
      {* BOXANSICHT *}
      {foreach name=aussen item=module_data from=$module_content}
      <div class="listingbox">
        <div class="lb_inner">
          <div class="lb_image">
          {if $module_data.PRODUCTS_IMAGE != ''}
            <a href="{$module_data.PRODUCTS_LINK}"><img class="unveil" src="{$tpl_path}css/images/loading.gif" data-src="{$module_data.PRODUCTS_IMAGE}" alt="{$module_data.PRODUCTS_NAME|onlytext}" /></a>
            <noscript><a href="{$module_data.PRODUCTS_LINK}"><img src="{$module_data.PRODUCTS_IMAGE}" alt="{$module_data.PRODUCTS_NAME|onlytext}" /></a></noscript>
         
     

    das hier ist vermutlich die stelle aus der product_info_v1.html
    mit der foreach schleife
     {if $more_images|@count > 0}

     
    Code: PHP  [Auswählen]
    <div id="product_details">
        {if $PRODUCTS_IMAGE != ''}
        <div class="pd_imagebox">
          <div class="pd_big_image">
            <a class="cbimages" title="{$PRODUCTS_NAME|onlytext}" href="{$PRODUCTS_IMAGE|replace:"info_images":"popup_images"}"><img itemprop="image" src="{$PRODUCTS_IMAGE}" alt="{$PRODUCTS_NAME|onlytext}" /></a>
          </div>
          <div class="zoomtext">{#zoomtext#}</div>
         {if $more_images|@count > 0}
            {foreach item=more_images_data from=$more_images}
            <div class="pd_small_image">
              <a class="cbimages" title="{$PRODUCTS_NAME|onlytext}" href="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"popup_images"}"><img class="unveil" src="{$tpl_path}css/images/loading.gif" data-src="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"thumbnail_images"}" alt="{$PRODUCTS_NAME|onlytext}" /></a>
              <noscript><a title="{$PRODUCTS_NAME|onlytext}" href="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"popup_images"}"><img src="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"thumbnail_images"}" alt="{$PRODUCTS_NAME|onlytext}" /></a></noscript>
            </div>                          
            {/foreach}
            <br class="clearfix" />
          {/if}
        </div>
        {/if}

    Über eine Rückmeldung würde ich mich freuen
    mir würde es schon sehr helfen, wenn ich wüsste, wie man auf diese variablen zugreifen kann.

    Viele Grüße
    Knut

    Linkback: https://www.modified-shop.org/forum/index.php?topic=39480.0
    Managed Server

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Hallo Knut,

    in Produktlisten steht dir die Smartyvariable $more_images nicht zur Verfügung.

    Gruss
    Hanspeter

    karsta.de

    • Experte
    • Beiträge: 3.156
    Also umsetzbar ist das. Ich denke mal man könnte das vielleicht auch updatesicher umsetzen.
    Hier ist ein Link wie es auf jeden Fall in der Version 1.0.6 funktioniert (schon mal die Hälfte der Arbeit für V2).
    ANLEITUNG: Zusätzliche Artikelbilder in Listingansicht.

    BG kgd

    hpzeller

    • Experte
    • Beiträge: 4.129
    • Geschlecht:
    Umsetzen bzw. implementieren kann man das natürlich, hier eine Idee.

    Diese Datei -> templates/tpl_modified/smarty/function.more_images.php mit folgenden Inhalt erstellen,

    Code: PHP  [Auswählen]
    <?php
    /*
     * Smarty plugin
     * -------------------------------------------------------------
     * File:     function.more_images.php
     * Type:     function
     * Name:     moreImages
     * Purpose:  outputs a random magic answer
     * -------------------------------------------------------------
     */

    function smarty_function_more_images($params, Smarty_Internal_Template $template)
    {
      if (empty($params['products_id'])) {
        $template->assign('more_images', array());
      } else {
        require_once (DIR_FS_INC.'xtc_get_products_mo_images.inc.php');
        $product = new product((int)$params['products_id']);  
        $mo_images = xtc_get_products_mo_images($product->data['products_id']);
        if ($mo_images != false) {
          $more_images_data = array();
          foreach ($mo_images as $img) {
            $mo_img = $product->productImage($img['image_name'], 'thumbnail');
            if ($mo_img != '') {
              $more_images_data[] = array ('PRODUCTS_IMAGE' => $mo_img);
            }
          }
          $template->assign('more_images', $more_images_data);
        } else {
          $template->assign('more_images', array());
        }
      }
    }
     

    dann in der Datei templates/tpl_modified/module/includes/product_listing_include.html nach

    Code: XML  [Auswählen]
      {* BOXANSICHT *}            
      {foreach name=aussen item=module_data from=$module_content}
      <div class="listingbox">
     

    und nach jeweils

    Code: XML  [Auswählen]
      {* ROWANSICHT *}
      {foreach name=aussen item=module_data from=$module_content}
      <div class="listingrow">
     

    diesen Code einfügen.

    Code: XML  [Auswählen]
        {more_images products_id=$module_data.PRODUCTS_ID}
        {foreach item=more_images_data from=$more_images}
        <div class="pd_small_image" style="z-index: 1;">
          <a class="cbimages" title="{$module_data.PRODUCTS_NAME|onlytext}" href="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"popup_images"}"><img class="unveil" src="{$tpl_path}css/images/loading.gif" data-src="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"thumbnail_images"}" alt="{$module_data.PRODUCTS_NAME|onlytext}" /></a>
          <noscript><a title="{$module_data.PRODUCTS_NAME|onlytext}" href="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"popup_images"}"><img src="{$more_images_data.PRODUCTS_IMAGE|replace:"info_images":"thumbnail_images"}" alt="{$module_data.PRODUCTS_NAME|onlytext}" /></a></noscript>
        </div>          
        {/foreach}
     

    Obiges ist, da es auf der Ebene des Templates erstellt wird, updatesicher. Den HTML-Code, welchen ich aus der Datei templates/tpl_modified/module/product_info/product_info_v1.html übernommen habe,  muss man natürlich noch an die Produktlistenansicht anpassen.

    Gruss
    Hanspeter

    Knut

    • Neu im Forum
    • Beiträge: 27
    hallo forum.
    ihr seid spitze!

    mit dem tipp von kgd und dem alten thread zum thema, siehe link
    ANLEITUNG: Zusätzliche Artikelbilder in Listingansicht (product_licting_v1.html)
    antwort 8 hat es mit etwas umschreiben auf die aktuelle version geklappt
    https://www.modified-shop.org/forum/index.php?topic=10244.0

    tausend dank!
    weiter so.
    neudeusch, "geiler scheiß"!
     :-)
    Viele Grüße
    Knut
    0 Antworten
    1758 Aufrufe
    29. November 2010, 18:01:43 von Glamko