In some cases you may want to use a listing within a listing. While you are listing the profiles you may want to list other entries made by this particular user on other applications. For example you may want show recent forum posts of the user on Browse Members page.
This can be a complicated task because listings are tend to conflict with each other. In order to prevent conflicts and make them work properly with each other you need to add some specific tags.
Let's assume our listing goes like this:
{LOOP:profile} ... (Some details) ..
{LOOP:blog} ... (Blog post details) ... {LOOP:end}
{LOOP:end}
If you use it like this there might be many conflicts. Page numbers will affect both of the listings. Also if you use other parameters on profile listing such as if_gender=male blog listing will give errors since there is no gender field on post form.
So what can we do to prevent these conflicts? Here is the protected version of blog listing:
{LOOP:profile}
... (Some details) .. {QUERY:owner_entries} {SET:closed:true}
{LOOP:blog}
... (Blog post details) ...
{LOOP:end}
{LOOP:end}
{QUERY:owner_entries} will use the login field of the outer listing on the inner listing. So only current user entries will be displayed in inner listing.
{SET:closed:true} will disable all access to this listing. For example, it will disable paging queries and other queries specified for profile listing.
Adding these two lines should prevent conflicts.
Tags:
listing
Related Articles:
Add a new comment
|
Send Comment