Feldgruppen an verschiedenen Positionen darstellen

  • Hallo


    Ich benutze Joomla2.5.27 VM2.6.12.


    Ich habe verschiedene Artikelattribute aufgeteilt in 2 Feldgruppen ("001" und "002"). Nun möchte ich in der Artikel Detailansicht alles was in FG 001 steht unter dem Artikel links und alles was in FG 002 steht unter dem Artikel rechts anzeigen, 2spaltig also.


    Die Anzeige in 2 Spalten funktioniert bereits, allerdings links und rechts komplett, also 001 und 002. Wo kann ich in der Abfrage die Werte für 001 und 002 eintragen?


    Hat jemand einen Tipp für mich?


    Hier meine default_customfields.php:


    <div class="product-fields">
    <div class="width48 floatleft" style="background:#f9f9f9; margin-right:5px; padding:10px;">
    <?php
    $custom_title = null;
    foreach ($this->product->customfieldsSorted[$this->position] as $field) {
    if ( $field->is_hidden ) //OSP Custom field "Hidden" ?
    continue;
    if ($field->display) {
    ?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
    <?php if ($field->custom_title != $custom_title && $field->show_title) { ?>

    <span class="product-fields-title"><?php echo JText::_($field->custom_title); ?></span>
    <?php
    if ($field->custom_tip)
    echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
    }
    ?>
    <span class="product-field-display"><?php echo $field->display ?></span>
    <span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
    </div>
    <?php
    $custom_title = $field->custom_title;
    }
    }
    ?>
    </div>

    <div class="width48 floatright" style="background:#f9f9f9; margin-right:5px; padding:10px;">

    <?php
    $custom_title = null;
    foreach ($this->product->customfieldsSorted[$this->position] as $field) {
    if ( $field->is_hidden ) //OSP Custom field "Hidden" ?
    continue;
    if ($field->display) {
    ?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
    <?php if ($field->custom_title != $custom_title && $field->show_title) { ?>

    <span class="product-fields-title"><?php echo JText::_($field->custom_title); ?></span>
    <?php
    if ($field->custom_tip)
    echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
    }
    ?>
    <span class="product-field-display"><?php echo $field->display ?></span>
    <span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
    </div>
    <?php
    $custom_title = $field->custom_title;
    }
    }
    ?>
    </div>

    <div class="clear"></div>
    </div>

  • ändere nicht die default_customfields.php


    guck dir die default.php an in vm3 ist es

    Code
    1. echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'onbot'));


    Da musst du nur die Position onbot mit deiner eigenen Austauschen, also z.b. myRight, myLeft


    Dieses Positionen schreibst du in die customfields, du kannst dort deine eigenen erfinden,


    in vm2 ist es btw

    Code
    1. if (!empty($this->product->customfieldsSorted['ontop'])) {
    2. $this->position = 'ontop';
    3. echo $this->loadTemplate('customfields');
    4. }


    da einfach ontop ändern. Das System is immer gleich in vm3 nur mehr commod.

  • Vielen Dank für die Antwort. Ich möchte sie allerdings nicht von der Position her verändern, sondern eben in die linke Spalte NUR die Customfiels aus der Feldgruppe "001" und in der rechten Spalte NUR die Customfields aus der Feldgruppe 002 einblenden

  • Vielen Dank für die Antwort. Ich möchte sie allerdings nicht von der Position her verändern, sondern eben in die linke Spalte NUR die Customfiels aus der Feldgruppe "001" und in der rechten Spalte NUR die Customfields aus der Feldgruppe 002 einblenden


    Sie können die Benutzerfelder eigenen Positionen zuordnen, auf denen Sie angezeigt werden sollen.


    Sie koennen verschiedene Benutzerfelder einer Gruppe zuordnen oder eben bestimmte Benutzerfelder einer gemeinsamen Position.


    Der Aufwand bleibt der selbe, jedoch hat Ihnen Herr Milbers bereits den Code fuer letztere Option bereitgestellt ;-)