1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xen:helper sortArrow

Discussion in 'XenForo Development Discussions' started by Mythotical, Oct 13, 2015.

  1. Mythotical

    Mythotical Well-Known Member

    Ok I know I have to use an array of fetchOptions but have not figured that out. Guess that is due to me figuring out other features of my add-on. So I'm here asking for guidance.

    Right now in my ControllerPublic file I have:
        $fetchOptions['perPage'] = $options->xenWow_RosterLimit;

    $page max(1$this->_input->filterSingle('page'XenForo_Input::UINT));
    $roster $rosterModel->getRosterList(array('perPage' => $fetchOptions['perPage'], 'page' => $page));
    My Model call function:
      public function getRosterList(array $fetchOptions)
    $limitOptions $this->prepareLimitFetchOptions($fetchOptions);

           SELECT roster.*, race.*, class.*, rank.*
           FROM xwow_roster AS roster
           LEFT JOIN xwow_races AS race ON roster.char_race = race.raceid
           LEFT JOIN xwow_class AS class ON roster.char_class = class.classid
           LEFT JOIN xwow_ranks AS rank ON roster.char_rank = rank.rank_id
           ORDER BY roster.char_rank ASC
    $limitOptions['limit'], $limitOptions['offset']
    EDIT: Template example that I'm looking at to make sure I have it correct when forming the link.
    <div class="guildBox guildCol2" style="border-left: 0px !IMPORTANT;">
                       <a href="{xen:link guild/roster, $rosterList, '_params={$orderParams.char_name}'}" class="title"><span>{xen:phrase xenWow_name}{xen:helper sortArrow, $rosterList, $orderDirection, char_name}</span></a>
    I want to turn that into a fetch where it is ordered by char_name, char_level, char_race, char_rank, or char_achievePoints similar to how you can sort threads.

    So a thread already created on the topic will do or examples will do or even a XenForo file or add-on will definitely do. Either way I'm sure I can figure it out from that.
    Last edited: Oct 13, 2015
  2. Mythotical

    Mythotical Well-Known Member

    I figured it all out. I'll do a tutorial in the coming days describing how to setup sorting on custom pages using your own data.
    insocial and Ark Royal like this.
  3. Mythotical

    Mythotical Well-Known Member

    Oi, had a friend come in for a visit from out of state. I ended up away from my computer for 4 days straight, I was losing my mind. Anyway, that has put me behind quite a bit so I'm still working on the guide. First part will be the guide itself using text and screenshots, next part will be a straight video.

Share This Page