solved Alphabetical member search

alt=
@hello77957
5 years ago
56 posts
Hi, I notice some sites have this function on their members lists.

Looking at view source I see they have lists of url/profiles/name/a etc.

If I want to make this function, do I create a page for each letter of the alphabet? or is the a code i'm missing which will return all the results on the same page?
updated by @hello77957: 07/14/19 11:01:06AM
paul
@paul
5 years ago
4,325 posts
Hi - This is fairly straightforward to do in Jamroom and I'd suggest you take a look at one of the skin templates that do this, eg. the MediaPro artists.tpl template.

Basically you generate an A-Z letter list and each letter links to the same page but with the letter as an argument in the url - http://yoursite.com/profiles/by_name/a
The letter would then be available to the template as $_post._1
You could then test for this and add it as a search option in a jrCore_list call -

{if isset($_post._1) && strlen($_post._1) == 1}
    {jrCore_list module="jrProfile" order_by="profile_name ASC" search="profile_name like `$_post._1`%"}
{else}
    {jrCore_list module="jrProfile" order_by="profile_name ASC"}
{/if}

Hope that makes sense


--
Paul Asher - JR Developer and System Import Specialist
alt=
@hello77957
5 years ago
56 posts
That's great, thanks Paul!
alt=
@hello77957
5 years ago
56 posts
Paul, i'm almost there, could you help me with:

How do I make the list quota specific? I tried adding profile_quota_id=, but either i'm writing it wrong or i'm putting it in the wrong place.

Also, when I click any of the letters I get a debug list come up. I haven't put debug on that template, have I somehow added it using the code you gave?
douglas
@douglas
5 years ago
2,767 posts
hello77957:
Paul, i'm almost there, could you help me with:

How do I make the list quota specific? I tried adding profile_quota_id=, but either i'm writing it wrong or i'm putting it in the wrong place.

Also, when I click any of the letters I get a debug list come up. I haven't put debug on that template, have I somehow added it using the code you gave?


Try using quota_id= instead.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
paul
@paul
5 years ago
4,325 posts
Yeah - What Douglas said. Include it as a jrCore_list parameter -

{jrCore_list module="jrProfile" order_by="profile_name ASC" quota_id=1 . . . }

If you want multiple quotas you'd need to do it as a search parameter -

{jrCore_list module="jrProfile" order_by="profile_name ASC" search1="profile_name like `$_post._1`%" search2="profile_quota_id IN 1,2,4}

As for the debug listing, if there isn't a {debug} in the template you're working on, there will likely be one left over in a 'row' template somewhere that is likely called by the jrcore_list.

hth


--
Paul Asher - JR Developer and System Import Specialist
alt=
@hello77957
5 years ago
56 posts
On the plus side, i've found the rogue {debug}

On the minus side, I can't get this to work, any letter I select returns all profile names and all quotas.

I'm obviously missing something somewhere...
paul
@paul
5 years ago
4,325 posts
Open a ticket with your admin login and the template you’re working on and I’ll take a look.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
researchcooperative
@researchcooperative
5 years ago
694 posts
@hello77957

You might like the implementation of this set up for me by the JR team at researchcooperative.org/profiles

I put all the sort and search options together in one place at the top of the page, and the necessary reset buttons are there too.

If you do like the set up, ask further on your support ticket to JR.


--
PJ Matthews, Kyoto
Migrated from Ning 2.0. Now at Jamroom 6 beta and using Jamroom Hosting for The Research Cooperative (researchcooperative.org)

Tags