URL to albums (LT 1.2)

URL to albums (LT 1.2)

Postby -J- on Mon Mar 05, 2007 10:57 am

Hi there,

I've got a problem in my settings. I use customs URLs, and I basically try to reduce the URLs size to the minimum.

The problem is with album_link_format :

When I change the default value of the setting (which is /blog/{blogname}/album/{albumname}$) to
Code: Select all
/{blogname}/album/{albumname}$


everything is OK...

everything is OK too with
Code: Select all
/blog/album/{albumname}$)

But when I change it to
Code: Select all
/album/{albumname}$


it doesn't work anymore ... any idea?
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm

Postby phunkphorce on Mon Mar 05, 2007 3:26 pm

Where does it take you to? Do you get the front page once again?
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby -J- on Mon Mar 05, 2007 6:12 pm

I don't get the fron page again but an error message

Error

The category identifier is not correct or no items were selected
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm

Postby phunkphorce on Tue Mar 06, 2007 3:39 am

Oh then that's not a bug. You have to design your URLs in a way that they don't clash or overlap with each other. At the moment it seems like category_link_format and album_link_format are somewhat overlapping, so when processing an album link, the link parser thinks that it's a category link. What have you defined your category links to?
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby -J- on Tue Mar 06, 2007 8:26 am

I see... my current settings

category_link_format: /{catname}/$

album_link_format: /album/{albumname}$

What do you think?
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm

Postby phunkphorce on Tue Mar 06, 2007 9:02 am

You need to remove the trailing slash from album_link_format: /{catname}$

Do that and it will work.
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby jondaley on Tue Mar 06, 2007 12:42 pm

I don't understand that fix. It seems like that would only apply when trying to visit a url like:

/album or /album/
but if you were going to /album/my-stuff
then due to the $ the category URL shouldn't be triggered.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby -J- on Tue Mar 06, 2007 12:51 pm

I was sure you would notice that ... but actually category links are not working anymore when I remove the last '/' I am convinced that several URL settings are overlapping :?

my settings (custom URLs)

permalink_format: /{postname}$

category_link_format : /{catname}$

blog_link_format : /$

archive_link_format : /archives/{year}/?{month}/?{day}

user_posts_link_format : /user/{username}$

post_trackbacks_link_format : /trackbacks/{postname}$

template_link_format : /page/{templatename}$

album_link_format : /album/{albumname}$

resource_link_format : /resource/{albumname}/{resourcename}$

Do you see a big mistake? :oops:
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm

Postby phunkphorce on Tue Mar 06, 2007 12:59 pm

permalink_format and category_link_format overlap with each other, how is the code supposed to know which one is which when receiving a URL such as http://www.yourserver.com/this-is-a-URL ? How can you tell whether this is a permalink or a category link?

I would advise to set permalink_format to /post/{postname} and category_link_format to /category/{catname}
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby -J- on Tue Mar 06, 2007 1:04 pm

I realize my mistake. I actually tried something like

permalink_format : /{catname}/{postname}

category_link_format to /{catname}

but it's not important, as everything is working now :)

Thank you very much!
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm

Postby jondaley on Tue Mar 06, 2007 1:09 pm

Can you post your final settings? It would be best to post them on the wiki, either on the page that talks about removing /blog is "evil" (that's how I search for the page) or else put a link from that page to a page explaining your URLs and showing examples - that would really help some people who want to shorten their URLs, but never seem to get it right.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby -J- on Tue Mar 06, 2007 1:18 pm

With pleasure :) I am doing this right now

Just a quick question: would it work with permalink_format : /{postname} ?

If I change this, I need to modify the blog_link_format I think.
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm

Postby -J- on Tue Mar 06, 2007 1:25 pm

Done!

I've updated the bottom of this page: http://wiki.lifetype.net/index.php/Custom_URLs#Examples

I hope I didn't leave any mistake!
-J-
 
Posts: 116
Joined: Sun Apr 03, 2005 4:02 pm

Postby jondaley on Tue Mar 06, 2007 2:58 pm

What do you have your page custom URL set to? I would expect that your template_link and page_suffix would conflict.

I think you are probably alright changing to the /{postname} though you have to do an additional .htaccess trick (like the one posted by ayalon recently) or a similar version.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby lavinya on Sun Dec 02, 2007 5:54 pm

HELLO.

I have 1.2.5 version on weblogtr.com
Custom url enabled. subdomains_enabled: yes.
All urls ok working.

But gallery 2. pages and comment 2. pages not working. :(

Custom url enabled
Here settings:
force_posturl_unique:yes
permalink_format: /post/{postname}$
category_link_format: /category/{catname}$
blog_link_format: /$
archive_link_format: /archives/{year}/?{month}/?{day}
user_posts_link_format: /user/{username}$
post_trackbacks_link_format: /trackbacks/{postname}$
template_link_format: /page/{templatename}$
album_link_format: /album/{albumname}$
resource_link_format: /resource/{albumname}/{resourcename}$
page_suffix_format: /page/{page}

example comment page 2. url:
sebinder.weblogtr.com/post/giresun-universitesi-sebinkarahisar-meslek-yuksek-okulu/page/2.html

remove .html and enter:
sebinder.weblogtr.com/post/giresun-universitesi-sebinkarahisar-meslek-yuksek-okulu/page/2
working :shock:

Example gallery page 2. url:
sebinder.weblogtr.com/album/sebinkarahisa-fotograflari/page/2.html
remove(.html) and enter working:
sebinder.weblogtr.com/album/sebinkarahisa-fotograflari/page/2

Any ideas ? :?
lavinya
 
Posts: 50
Joined: Sun Aug 12, 2007 11:24 am
Location: Turkey

Next

Return to LifeType 2.0 Development

cron