Simple questions (probably)
Posted: Fri Dec 15, 2006 5:05 pm
Hi, I'm converting a semi-static website to CMSMS, but for that I need to write a few custom modules. I'm new to module design and I have just started development of my first module, starting from the Skeleton module. The front-end of the module is nearly complete, but I have a few annoyances I want to get rid of.
To start, here's a link to the actual module as it currently is:
http://www.funpages.be/pokerama/index.php?p=woordenboek
The site is in dutch, but you can see what the module does. It has a list of words (stored in a database table) and when clicked you will be sent to a page showing the meaning for that word.
At the top of the page, there's a list of shortcuts using the first character of the words. The goal is that when a user presses a starting character, it jumps down the page to the specified anchor. All anchors are in place, I'm just having a bit of trouble with getting the links correct. I'm just linking to #character, but appearantly I get sent to /#character rather than /index.php?p=currentpage#character. How can I make a link to the same page the user is currently on? I assume I will need to get the pagealias and the name of the page variable i choose when installing (in this case "p" rather than the default "page"). Any pointers on where to find these values?
A second, somewhat related issue, is that when views a detail page, there's a link to return to the previous page. I'm using the createlink function to do this, using the id of the module. It would be nicer though if I would simply link back to ?p=woordenboek instead. Again I'll probably need the name of the page, and the name of the page variable.
And last, since where's at it anyway, I'd like to use a form of pretty urls for the urls of the detail pages. It should look like:
index.php?p=woordenboek&word=word
The reason I want exactly that format, is because the current site is using that format as well, and I want to keep any incoming links or search engine listings working.
Any help is appreciated
Tom
To start, here's a link to the actual module as it currently is:
http://www.funpages.be/pokerama/index.php?p=woordenboek
The site is in dutch, but you can see what the module does. It has a list of words (stored in a database table) and when clicked you will be sent to a page showing the meaning for that word.
At the top of the page, there's a list of shortcuts using the first character of the words. The goal is that when a user presses a starting character, it jumps down the page to the specified anchor. All anchors are in place, I'm just having a bit of trouble with getting the links correct. I'm just linking to #character, but appearantly I get sent to /#character rather than /index.php?p=currentpage#character. How can I make a link to the same page the user is currently on? I assume I will need to get the pagealias and the name of the page variable i choose when installing (in this case "p" rather than the default "page"). Any pointers on where to find these values?
A second, somewhat related issue, is that when views a detail page, there's a link to return to the previous page. I'm using the createlink function to do this, using the id of the module. It would be nicer though if I would simply link back to ?p=woordenboek instead. Again I'll probably need the name of the page, and the name of the page variable.
And last, since where's at it anyway, I'd like to use a form of pretty urls for the urls of the detail pages. It should look like:
index.php?p=woordenboek&word=word
The reason I want exactly that format, is because the current site is using that format as well, and I want to keep any incoming links or search engine listings working.
Any help is appreciated
Tom