stormy Posted September 7, 2017 Share Posted September 7, 2017 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. Link to comment Share on other sites More sharing options...
brian! Posted September 7, 2017 Share Posted September 7, 2017 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. Link to comment Share on other sites More sharing options...
stormy Posted September 7, 2017 Author Share Posted September 7, 2017 Brian you are the best!!! Thank you! Link to comment Share on other sites More sharing options...
stormy Posted November 14, 2017 Author Share Posted November 14, 2017 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. Link to comment Share on other sites More sharing options...
brian! Posted November 14, 2017 Share Posted November 14, 2017 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. Link to comment Share on other sites More sharing options...
stormy Posted November 14, 2017 Author Share Posted November 14, 2017 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. Link to comment Share on other sites More sharing options...
brian! Posted November 15, 2017 Share Posted November 15, 2017 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. 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. Link to comment Share on other sites More sharing options...
stormy Posted November 15, 2017 Author Share Posted November 15, 2017 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 Link to comment Share on other sites More sharing options...
brian! Posted November 16, 2017 Share Posted November 16, 2017 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. Link to comment Share on other sites More sharing options...
Recommended Posts