MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Rbug in loop? (MV 3.12)



******    message to minivend-users from mikeh@minivend.com     ******

Quoting Karl M. Joch (k.joch@eushop.net):
> 
> it looks like th is a small bug in the loop tag. i use:
> 
> loop on category 1
>     loop on category 2
> 
> with the search parameter on a mysql table. normally everything works fine
> except when the result for the loop on category 1 is only one record and the
> result field contains 2 words seperated by a space. then loop-code-a is
> listed 2 times. first time with word1 and second time with word2. changing
> the category to word1-word2 and everything is fine. if the result of the
> query is more the one record and the space seperated field is not the first
> result everything is fine too.

Not a bug, but perhaps hard to field from the docs.

To mandate each line as a loop-code, instead of space-separated values,
define mv_search_line_return, or the lr=1 parameter. Here is an example for
the simple demo:

<PRE>
<U>Loop</U>
[loop search="
			se=Mona
			sf=title
			rf=title
			"]
--&gt;[loop-code][/loop]

<U>Loop lr=1</U>
[loop search="
			se=Mona
			sf=title
			rf=title
			lr=1
			"]
--&gt;[loop-code][/loop]
</PRE>


-->Mona
-->Lisa


-->Mona Lisa

is what should appear.

This allows you to loop over searches that will return multiple
values for a single field. I find it useful for selecting a database
record based on more than one field or on things other than the key.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
Fast, reliable, cheap.              131 Willow Lane, Floor 2  | ||  _ \
Pick two and we'll talk.            Oxford, OH  45056         | || |_) |
 -- unknown                         <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: