If you want to use this within the context of a Views listing, you should have a look at the Views Natural Sort module (<a href="http://drupal.org/project/views_natural_sort">http://drupal.org/project/views_natural_sort</a>). That module might be able to help you out of the box.<div>
This won't change the node title on the detail page though...</div><div><br></div><div>Sven</div><div>
<br><br><div class="gmail_quote">On Mon, Aug 2, 2010 at 5:23 PM, Benjamin Jacob <span dir="ltr"><<a href="mailto:ben4asterisk@yahoo.com">ben4asterisk@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Thanks guys for your responses.<br>
Will try the regex thing for sure.<br>
I am not sure if either page title or automatic nodetitles solve my problem off-the-shelf.<br>
<br>
This is pretty common in different listings, e.g. book listing, video/movie listing, etc.<br>
e.g. The Final Frontier = Final Frontier, The<br>
24 Chowringee Lane = Chowringee lane, 24<br>
etc.<br>
<br>
Quite surprising that (as I say) off-the-shelf modules are not available with Drupal. I am not a PHP/Drupal expert (as of yet) but can write this in C/C++ in a jiffy. I hope some of you experts take note :-)<br>
<br>
This can be an added feature in the existing modules you described, where the user can specify different tokens (extracted from the title) he/she wants to be appended to the title.<br>
<br>
Thanks again.<br>
- Ben<br>
<br>
<br>
--- On Mon, 8/2/10, Joe CodeWaggle <<a href="mailto:joe@codewaggle.com">joe@codewaggle.com</a>> wrote:<br>
<br>
> From: Joe CodeWaggle <<a href="mailto:joe@codewaggle.com">joe@codewaggle.com</a>><br>
> Subject: Re: [support] node titles - move "the", numbers to the end<br>
> To: <a href="mailto:support@drupal.org">support@drupal.org</a><br>
> Date: Monday, August 2, 2010, 4:45 AM<br>
<div><div></div><div class="h5">> Had another thought:<br>
><br>
> You can use a PHP regex function to manipulate the title,<br>
> try<br>
> preg_replace().<br>
><br>
> Assuming that your template is based on phptemplate (the<br>
> Drupal default<br>
> template engine), you can work in the "template.php" file<br>
> in your theme<br>
> folder (you can create one if none exists).<br>
><br>
> Use the hook for _preprocess_page():<br>
> phptemplate_preprocess_page(&$vars) or ( "your<br>
> template<br>
> name"_preprocess_page(&$vars) ).<br>
><br>
> Work with $vars['title'].<br>
><br>
> Code Example:<br>
> phptemplate_preprocess_page(&$vars) {<br>
> // Manipulate the Page Title<br>
> $current_title = $vars['title'];<br>
> $searchPattern = '/(.*)(\sthe\s)(.*)/';<br>
><br>
> $new_title = preg_replace($searchPattern, '$1 $3$2',<br>
> $current_title);<br>
> $vars['title'] = $new_title;<br>
> }<br>
><br>
> The search pattern looks for " the ". It keeps track of the<br>
> parts of the<br>
> title, so you can rearrange the pieces.<br>
><br>
> If $current_title was 'where is the yummy candy',<br>
> $new_title would be 'where is yummy candy the'.<br>
><br>
> Part one($1) contains 'where is', part two($2) contains '<br>
> the ' and part<br>
> three($3) contains 'yummy candy'.<br>
><br>
> Regular Expressions can get pretty involved, so if you<br>
> haven't used them<br>
> before you'll need to spend some time learning how to<br>
> create the search<br>
> pattern that you need.<br>
><br>
> Here are a few links to the PHP manual:<br>
> <a href="http://www.php.net/manual/en/book.pcre.php" target="_blank">http://www.php.net/manual/en/book.pcre.php</a><br>
> <a href="http://www.php.net/manual/en/function.preg-replace.php" target="_blank">http://www.php.net/manual/en/function.preg-replace.php</a><br>
> <a href="http://www.php.net/manual/en/reference.pcre.pattern.syntax.php" target="_blank">http://www.php.net/manual/en/reference.pcre.pattern.syntax.php</a><br>
><br>
> A quick Google for "regular expression" or regex will turn<br>
> up tons of info.<br>
><br>
> Joe<br>
><br>
><br>
> -----Original Message-----<br>
> From: <a href="mailto:support-bounces@drupal.org">support-bounces@drupal.org</a><br>
> [mailto:<a href="mailto:support-bounces@drupal.org">support-bounces@drupal.org</a>]<br>
> On<br>
> Behalf Of Benjamin Jacob<br>
> Sent: Sunday, August 01, 2010 2:08 PM<br>
> To: Drupal Support MailList<br>
> Subject: [support] node titles - move "the", numbers to the<br>
> end<br>
><br>
><br>
> Hi,<br>
><br>
> Any way in drupal to manipulate titles so as to have words<br>
> like "the"/"a",<br>
> and numbers to the end?<br>
><br>
><br>
> Thanks in advance.<br>
> - Ben<br>
><br>
><br>
> <br>
> --<br>
> [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
><br>
> --<br>
> [ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
><br>
<br>
<br>
<br>
--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br>
</div></div></blockquote></div><br></div>