x
 
Create New Page
 View Previous Changes    ( Last updated by Eric Barstad )

Sort Entries by Title Ignoring The A An

Category:Hacks

Changes are made at your own risk and are not guaranteed to work. Always make backups of the database and files prior to implementing hacks. Make a special backup of the file and/or template you are modifying so that you can roll back quickly.

Hacks are dangerous and can cause your site to stop working. They make later updates to ExpressionEngine more difficult; you should track your hacks for post-update re-implementation. 

Most hacks are unnecessary, please review the Development Documentation for information on expanding ExpressionEngine via Modules, Extensions, and Plugins.

Hacks are never officially supported.

To sort weblog entries by title, ignoring the leading definite and indefinite articles (The, A, An), edit mod.weblog.php. Look for (around line 2202 in 1.5.2 / line 2321 in 1.6.0):

case 'title' 
$end .= "t.title";
break; 

and change to:

case 'title' 
$end .= "TRIM(leading 'an ' FROM TRIM(leading 'a ' FROM  TRIM(leading 'the ' FROM LOWER(t.title))))";
break; 

Forum Post

Category:EE1

Categories: