× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

{joodb ifis}

  • i_no_k
14 years 1 month ago - 11 years 8 months ago #98 by i_no_k
{joodb ifis} was created by i_no_k
Hello!

Thanks for this plugin!
Small question: if I use 2 or more {joodb ifis}...{joodb endif} constructions, nested one to another, the result is not that which is expected. Example: building path to the file from item name.


{joodb loop}{joodb ifis|Amount} //show item only if amount of em is not NULL
<.....>
//depending on props of item in table we build path to image
<.....>
{joodb endif}{joodb loop}
In the result of this cod we get page with unexpected result.
Maybe perhaps to add at next version the ability to specify in closer tag - what exactly it close?
Example: {joodb ifis|Number}......{joodb endif|Number}
Last edit: 11 years 8 months ago by joest.

Please Log in to join the conversation.

  • Dirk.Hoeschen
14 years 1 month ago #100 by Dirk.Hoeschen
Replied by Dirk.Hoeschen on topic Re:{joodb ifis}
sorry i was to lazy to implement real recursive routines but normally somethig like
{joodb ifis|field1}hello{joodb ifis|field2}world{{joodb endif}{joodb endif}
should work.
I will check it.



[i_no_k 2010-03-04 09:59:45]:
Small question: if I use 2 or more {joodb ifis}...{joodb endif} constructions, nested one to another, the result is not that which is expected. Example: building path to the file from item name.



{joodb loop}{joodb ifis|Amount} //show item only if amount of em is not NULL
<.....>
//depending on props of item in table we build path to image
<.....>
{joodb endif}{joodb loop}
In the result of this cod we get page with unexpected result.
Maybe perhaps to add at next version the ability to specify in closer tag - what exactly it close?
Example: {joodb ifis|Number}......{joodb endif|Number}



Please Log in to join the conversation.

  • i_no_k
14 years 1 month ago #101 by i_no_k
Replied by i_no_k on topic Re:{joodb ifis}
Thanks for quick answer!

Construction in your example - isn't work.

It's piece of template for catalog view what I use now in my catalog of collectible card's. It's work until I'm insert one else {joodb ifis|...} after first loop and {joodb endif} before second loop. Or until I try to complicate generation path to image with another ...ifis.

<...>
{joodb loop}
<...>
<td width="150"><img src="images/mtg_pics/{joodb Set_name}/{joodb ifis|Tips}tip_{joodb endif}{joodb Language}{joodb ifis|Token}_tok{joodb endif}/small/{joodb Card_number_in_set}.jpg" border="0" width="150" style="border: 0pt none; float: left; margin-left: 5px; margin-right: 5px;" /></td>
<td valign="top">
<...>
{joodb loop}
<...>

Please Log in to join the conversation.

  • c.dickert@gmx.de
11 years 8 months ago #1037 by c.dickert@gmx.de
Replied by c.dickert@gmx.de on topic Re:{joodb ifis}
Hallo,

ich habe das gleiche Problem. irgendwie funktionert manchmal die Verschachtelung und manchmal nicht. Gibt es irgendwelche Regeln (Tricks), die man beachten muss?

Gruß
Claus

Da mein Engisch sehr schlecht ist hier die (vielleich nicht bessere) Übersetzung von Google:
Hello,

I have the same problem. somehow works! sometimes and sometimes not nesting. Are there any rules (tricks) to pay attention to?

greeting
Claus

Please Log in to join the conversation.

More
11 years 8 months ago #1038 by Dirk
Replied by Dirk on topic Re:{joodb ifis}
Das ist ein zwei jahre alter Thread. Wir haben erst letzte Woche mit Version 1.8.2 eine überarbeitete IFIS Funktion veröffentlicht.

In allen Fällen brauchen wir aber ein Beispiel aus dem Template und die dazugehörige SQL-Struktur und Datenwerte.

Manchmal kann es schon an der Sortierung in der Datenbank liegen, dass die Bedingung nicht so erkannt wird wie gewünscht.

Please Log in to join the conversation.

More
11 years 3 months ago #1530 by Midge
Replied by Midge on topic Re: {joodb ifis}
Ich möchte das Thema auch noch einmal augreifen. Wenn ich die Funktionsweise der function {joodb ifis} in Kombination mit {joodb else} richtig verstehe, so vergleicht diese, ob der Inhalt einer DB-Spalte und ein eventuell angegebener Wert (value), die Bedingung (condition) erfüllt oder nicht. Ist die Bedingung (abhängig vom Vergleichsoperator) nicht erfüllt, verbleibt nur noch {joodb else} um eine alternative Ausgabeoption anzugeben?

Innerhalb der selben {joodb ifis} Schleife, weitere alternative Bedingungen zu überprüfen, wie mit "elseif" möglich, ist offensichtlich nicht vorgesehen. Somit würde (wenn ich richtig liege) nur die Möglichkeit verbleiben, für jede gewünschte Ausgabe- oder Anzeigeoption innerhalb einer Spalte, eine weitere separate {joodb ifis} Abfrage, mit einem neuen Vergleichswert einzubauen?

Mal angenommen, ein Nutzer hätte eine Datenbank mit ca. 1500 Datensätzen. Die Ausgabe erfolgt im Katalog, in einer Tabelle mit 8 Spalten. In einer Spalte möchte er den jeweiligen, aus der DB stammenden Integer-Wert, einer von 5 unterschiedlichen Ausgabe- oder Anzeigeoptionen (z.B. unterschiedliche Bilder, Links, Texte oder Funktionen) zuordnen. Dann müsste er 4 separate {joodb ifis} Abfragen (die letzte inklusive einer {joodb else}) bemühen? Das wären ja im schlimmsten Fall 6000 separate Abfragen um nur eine Spalte auszugeben. Ist diese Verfahrensweise, im Verhältnis zur "elseif" Methode (speziell bei größeren Datenbanken), nicht sehr ressourcenlastig?

Als Laie, versuche ich mir die Situation gerade bildlich vorzustellen. Ein Kunde steht in einem Laden und fragt einen Verkäufer: "Ist dieser Pullover auch in rot erhältlich?" Der Verkäufer geht ins Lager und schaut ausschließlich ob der gewünschte Pullover auch in rot verfügbar ist. Er kommt kurze Zeit später wieder und sagt "Nein, Leider nicht". Jetzt geht das Spiel von vorn los... "Ist dieser Pullover vielleicht in grün erhältlich?" ... Spätestens bei der dritten Farbe hat der Verkäufer wunde Füße. ;-)

Effektiver wäre es doch, wenn der Verkäufer nur einmal ins Lager müsste, alle verfügbaren Optionen gleich analysiert und diese den möglichen Antworten sofort zuordnen kann.
  1. Grün: Ist nur noch in der Größe M erhältlich
  2. Rot: Ist leider ausverkauft
  3. Blau: Ist momentan nicht erhältlich. Kommt aber Anfang nächster Woche wieder rein
  4. Schwarz: Ist erhältich und sogar im Angebot

Please Log in to join the conversation.

Moderators: Dirkjoest