Questions...
lukgoh |
|
---|---|
Hello guys, I am completely new to URL transformation and with help I setup my Cotonti to use the Handy URLs, which is perfect. I have created a module and to get the same results (www.domain.com/module/$u) I added a page that hooks into urleditor.functions.php like this: <?php /* ==================== [BEGIN_COT_EXT] Hooks=urleditor.rewrite.first [END_COT_EXT] ==================== */ /** * Clan Module for Cotonti CMF * * @package Clan * @version 1.0 * @author DesignLizard * @copyright (c) 2012 DesignLizard * @license BSD */ defined('COT_CODE') or die('Wrong URL'); if ($path[0] == 'clans') { // Clan profiles $_GET['e'] = 'clans'; $_GET['u'] = $path[1]; return; } ?> My question/problem is when creating a url like this: cot_url('clans', 'u=' . $rowgettopclans['clan_name_short']) it outputs a link like this: /clans?u=mli instead of clans/mli which is the correct link. I was wondering what I am doing wrong, or what needs to be done to get the correct url. |
Trustmaster |
|
---|---|
I'm sorry that this is undocumented, but out of the box with Handy preset, URLeditor understands 3 types of magic parameters, inherited from 'page' module:
You don't even need to hook into urleditor to use them. May the Source be with you!
|
lukgoh |
|
---|---|
Thanks Trustmaster, I'm now using $c for the clans which is working great. However, if I remove my hook I can no longer view a clan via /clans/clanname |
|
Dit bericht is bewerkt door lukgoh (2012-05-01 20:45, 13 jaren ago) |
Trustmaster |
|
---|---|
This is because it looks for an entry in $structure array for your module and that category. As there is no such a record, it falls back to $al. So you'd better use $al instead of $c. May the Source be with you!
|
lukgoh |
|
---|---|
oh okay, awesome thank you. |