[ic] Sorting depending on a part of a field

goetz at verdieck.de goetz at verdieck.de
Thu Jan 27 15:59:03 EST 2005


Hi list,


I try to sort a list depending on a part of the content of a field.
The content of the field named feature_list is for example:
Schnittstelle: ATA/ Kapazität: 60 GB/ 5400 rpm/ Cache: 8 MB/KB/ Formfaktor:
2,5 "

So I want a drop down list with entries:
Schnittstelle,Kapazität,Cache,Formfaktor

I know how to extract the values ATA 60 8 2,5

For example with a part for extracting the number for "Kapazität":
[set item_sku][item-code][/set]
        [perl table=products code=[item-code]]
          my $feature_item = "Kapazität";
          my $feature_field = "ARTIKEL2";
          my $code_item = $Scratch->{item_sku};
          # wenn field_inhalt[$i] Kapazität speichern
          my $tmpl= $Tag->data('products', $feature_field, $code_item);
          if ($tmpl =~ m/Kapazität: (\d+) GB/g) {
            $tmpl =$1;
             return $tmpl;}else{
             return "-";
          }
        [/perl]


The part for the drop down menu part is like:
......
<select name=sort_field onChange="this.form.submit()">
[loop acclist=1
list="manu_name=Hersteller,price=Preis,ARTIKEL2=Kapazit&auml;t"]
<option value="[loop-code]" [selected name=sort_field
value="[loop-code]"]>[loop-param label]
[/loop]
</select>
<input type=submit value="Sortieren">
</form>
</td>
</tr>
</table>

[search-region more=1
            search="
                fi=products
                st=db
                co=1
                sf=prod_group
                se=Festplatten
                op=eq
                nu=0
                sf=category
                se=[value category]
                ml=25
                tf=[value sort_field]    # should be a selected part of
ARTIKEL2
                "
]

But how can I put the things together ?

I hope I could make my problem clear.

Thanks for hints  or a push in the right direction.

Götz Verdieck











More information about the interchange-users mailing list