Active Resource Sort Order

Discussion in 'Troubleshooting' started by itskris, Mar 18, 2012.

  1. itskris

    itskris New Member

    Joined:
    Sep 29, 2009
    Messages:
    3
    The sort order for my active resource section isn't in alpha or numerical order... It isn't even in the order that they pages were created...

    How do I sort the list at all???

    Attached Files:

  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    What version of amember is this?

    David
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    I guess it is v4.
    They should be sorted by purchase date. This order can be changed.
    You have to customize /amember/application/default/views/blocks/member-main-resources.phtml
    change this block:
    PHP:
        <?php foreach ($resources as $r): if ($l $r->renderLink()) : ?>
        <li><?php echo $l?></li>
        <?php endif ; endforeach ?>
    PHP:
        <?php usort($resourcescreate_function('$a, $b''return strcmp($a->getLinkTitle(), $b->getLinkTitle());')); ?>
        <?php foreach ($resources as $r): if ($l $r->renderLink()) : ?>
        <li><?php echo $l?></li>
        <?php endif ; endforeach ?>
  4. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    That worked- thanks. (just copy and paste that 1st line above the existing code).

    I'd request this be added as an option in the GUI of the links page.
    Sort by Title / Access Date
    Or a sort order field like you have in products.

    David
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    David,
    We plan to implement such sort options in aMember CP -> Protect Content
  6. kinitex

    kinitex Member

    Joined:
    Aug 28, 2009
    Messages:
    50
    Was this ever implemented? I'm not seeing any options to sort active resources. I even uploaded my files in order of how I wanted them sorted and it still sorted them randomly on the member page. wtf?
  7. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Unfortunately, this option has not been implemented yet, it is in development for next major release. If you need this ASAP, please contact us via helpdesk and we will try to give you solution for your case.
  8. jackgordon

    jackgordon Member

    Joined:
    Mar 23, 2009
    Messages:
    269
    I vote to add a sort order to this as well. I am not a fan of chaos :)

Share This Page