How to generate an alias

General project discussion. NOT for help questions.
Post Reply
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am

How to generate an alias

Post by FantomCircuit »

Just a simple question (I think)

I am developing a shop module, and need a way of making an alias name for a product so that I can use it for pretty urls, image naming schemes etc. (the same way one is generated for new pages; title changed to lowercase and is different to any existing alias).

Is there a function somewhere that is used for the page alias generation? I had a look through the source but can't seem to find anything (I am probably going blind :) )

Can someone point me in the right direction?
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am

Re: How to generate an alias

Post by FantomCircuit »

Ok, I've had a bit more of a look, and found the munge_string_to_url function, which makes it lowercase and gets rid of funny characters. Now I spose I can just re-create the functionality to make sure it is unique.
savagekabbage
Forum Members
Forum Members
Posts: 75
Joined: Mon Apr 23, 2007 3:51 pm

Re: How to generate an alias

Post by savagekabbage »

There are already several shop modules in the forge, maybe you could just modify one of those for your needs?  You also might want to look at how the core generates aliases, maybe you could just use that.
Post Reply

Return to “General Discussion”