Jump to content
stormy

List active domains by default

Recommended Posts

Is there a way (maybe with jquery?) to have the list of domains in the client area default to "Active" status?

 

We keep getting requests from customers that have a long list of cancelled/expired domains and have to click "Active" in the sidebar every time they login to configure something.

Share this post


Link to post
Share on other sites

if you're talking about clientareadomains, you could use an action hook to do that or you can do it in the template...

 

<?php

/**
* Client Area Domains - Sort By Status
* @author brian!
*/

function clientarea_domains_sort_hook($vars) {

   return array("orderby" => "status");
}
add_hook("ClientAreaPageDomains", 1, "clientarea_domains_sort_hook");
?>

that would sort the table by status, so "Active" domains should be top of the list. :idea:

Share this post


Link to post
Share on other sites

Hi Brian! For some reason this has stopped to work :( Anyway, since I'm asking - would there be a way to change the selection in the sidebar instead? i.e. preselecting "Active" in the top sidebar section, so only active domains are shown.

Share this post


Link to post
Share on other sites
7 minutes ago, stormy said:

Hi Brian! For some reason this has stopped to work :(

on which version? just tested on a v7.4RC using "Six", and it's working fine. :idea:

Share this post


Link to post
Share on other sites

I'm still on v6, but I'm using the Six theme as well. Domains appear sorted by domain name, I tested it on two different users. There are no errors in the javascript console or anything.

Share this post


Link to post
Share on other sites
18 hours ago, stormy said:

I'm still on v6, but I'm using the Six theme as well.

in general, it's always good to mention which version you're using as that can make all the difference with regards to templates and hooks. :idea:

18 hours ago, stormy said:

Domains appear sorted by domain name, I tested it on two different users. There are no errors in the javascript console or anything.

i've just tried the hook on v6.2.2 and it's working fine - are you sure the hook is running ? it's not a browser cache issue ??

if you had to, you could come at this from a different angle, edit clientareahome.tpl and change...

<a href="clientarea.php?action=domains">

to...

<a href="clientarea.php?action=domains&orderby=status">

that would effectively do the same as the hook and default to sorting the table by status value - meaning active domains would be shown first... and you could expand that to using a navbar hook to change the "My Domains" link to do the same thing - however, none of this should be necessary if you could find out if the original hook is running.

Share this post


Link to post
Share on other sites

If I activate the hook debugging I can see it's getting loaded. Maybe some other hook interferes with it? I don't know how I could debug it. It's not the template, because I have the original six and my modified version, and it happens on both. And it's not the browser, because it happens on both Safari and Firefox.

Anyway, I'll try your other suggestion, it's pretty much foolproof :)

Share this post


Link to post
Share on other sites
19 hours ago, stormy said:

If I activate the hook debugging I can see it's getting loaded. Maybe some other hook interferes with it?

possibly - but it's not the most complex of hooks, so i'm struggling to think what it could clash with. :?:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines