Jump to content

Sort TLD at domain page


DATmedia

Recommended Posts

Hi,

if you want to sort your tlds on domain page alphabetically you could add the following php function to "/templates/website/your-template/domain.php".

Search for the line (in modern theme it is line 766)

<?php
	if(isset($tldList) && is_array($tldList) && sizeof($tldList)){
		foreach($tldList AS $row){

and add before the foreach this line:

usort($tldList, function($a, $b) {
	return strcmp($a['name'], $b['name']);
});

So it looks like:

<?php
	if(isset($tldList) && is_array($tldList) && sizeof($tldList)){
		usort($tldList, function($a, $b) {
			return strcmp($a['name'], $b['name']);
		});
		foreach($tldList AS $row){

Voila, your array $tldList will be sorted alphabetically.

Regards
Philipp

Edited by DATmedia
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...