Can url_title contain a dot?
Posted: 12 May 2007 01:23 PM   [ Ignore ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15380
Joined  05-15-2004

I have a client who wants to recreate the current site to the letter, using EE. Unfortunately this includes the URL structure, too. While having templates named “something.php” looks akward, it works. Not so on an article level, however. I am looking for a way to get

http://example.com/templategroup/template/url_title.php

where url_title.php would be the actual url_title of the article, only EE always removes the dot when saving. Any ideas? Willing to hack if need be.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 12 May 2007 04:06 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15833
Joined  06-03-2002

You could hack to allow it, though I’m puzzled by the insistence on leaving .php when the new publishing system will not demand it.  Why do they want their site’s technology to be disclosed so blatantly when it’s not necessary.  Aaaanyhoo:

In core.regex.php, create_url_title() function, you’ll need to remove the \. from the $trans array (both if the separator type might change down the road), as well as cp.publish.php, the liveUrlTitle() JavaScript function’s NewText.replace() statement.

And you already know this, but for the benefit of others coming across this thread, hacks are not supported. :-D

 Signature 
Profile
MSG
 
 
Posted: 13 May 2007 01:28 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15380
Joined  05-15-2004
Derek Jones - 12 May 2007 04:06 PM

You could hack to allow it, though I’m puzzled by the insistence on leaving .php when the new publishing system will not demand it.

Ah, there you have me. I am only sub-contracted to develop certain aspects of the site, though, mainly implementing the simple commerce module and doing some server fu, so in this case it is slightly above my pay grade to question the client’s motives too much. I have advised, they did not heed it, I implement. Yes, I get paid by the hour.

In core.regex.php, create_url_title() function

Thank you. I knew that, in theory, but didn’t find it right away and also wanted to make sure.

And you already know this, but for the benefit of others coming across this thread, hacks are not supported. :-D

Oh, I do know, and I hate them, too. Which is what got me thinking last night: perhaps using mod_rewrite is a more upwards compatible solution. Only if that approach fails will I actually resort to this hack. Thanks again, Derek.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 13 May 2007 02:08 AM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15380
Joined  05-15-2004

OK, that actually worked. For posteriority’s sake, here’s my partial .htaccess:

RewriteRule ^(.+)/my_template/(.+)\.php $1/my_template/$2 [NC, L]

In the template I then simply use:

<a href="/my_template/{url_title}.php">

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 13 May 2007 06:22 AM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15833
Joined  06-03-2002

Huzzah for sneakiness!

 Signature 
Profile
MSG
 
 
Posted: 13 May 2007 10:45 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  04-24-2002

Nice little rewrite rule. Think I’ll copy that down for possible future use.

 Signature 

chrisruzin.netTextMate EE BundleTextMate EE Developer Bundle • Pro Network member
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 10 October 2008 07:32 PM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  11
Joined  09-13-2008

Hello,

Is this an issue that is beig addressed in the 1.65 release or the 2.0 release, or does it have to be handled through the .htaccess file as your pointed out?

Thanks in advance for any help you can provide.

Best,

Justin

Profile
 
 
Posted: 10 October 2008 08:39 PM   [ Ignore ]   [ # 7 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15833
Joined  06-03-2002

Periods will be allowed in URL titles beginning with version 1.6.5.

 Signature 
Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64944 Total Logged-in Users: 68
Total Topics: 81925 Total Anonymous Users: 50
Total Replies: 440355 Total Guests: 289
Total Posts: 522280    
Members ( View Memberlist )