Hey Guys,
first of all I want to thank you for that great component. Its just unbelievable what you can do with it. It makes many other components simply redundant.
I'm about to set up a website for a social project. Right now, CF its still free licence, but as soon as I see that everything I plan can be done with CF, I will buy a premium licence of course.
Problem:
So, I set up some forms and listing forms. The only thing I missed was the router.php, or some other way to handle handsome urls. So I created one router.php in the component folder (added of course also to .xml).
The Router.php looks like that
So, working so far --> URL looks like that
http://*mysite*/*lang*/*itemname*/*formname*/*token*
for example
http://www.thisisagreatsite.com/en/menu_one/view_my_form/8duswsa9hdw39jcds233w
But I'm struggling with the token. Whatever I put in the ParseRoute $vars['token'] its not parsing anything. Does maybe someone have a hint for me?
Thank you!
first of all I want to thank you for that great component. Its just unbelievable what you can do with it. It makes many other components simply redundant.
I'm about to set up a website for a social project. Right now, CF its still free licence, but as soon as I see that everything I plan can be done with CF, I will buy a premium licence of course.
Problem:
So, I set up some forms and listing forms. The only thing I missed was the router.php, or some other way to handle handsome urls. So I created one router.php in the component folder (added of course also to .xml).
The Router.php looks like that
function chronoformsBuildRoute( &$query )
{
$segments = array();
if(isset($query['chronoform']))
{
$segments[] = $query['chronoform'];
unset( $query['chronoform'] );
}
if(isset($query['token']))
{
$segments[] = $query['token'];
unset( $query['token'] );
}
return $segments;
}
function chronoformsParseRoute( $segments )
{
$vars = array();
switch($segments[0])
{
case 'view_my_form':
$vars['chronoform'] = 'view_my_form';
$vars['token'] = '';
break;
case 'view_my_second_form':
$vars['chronoform'] = 'view_my_second_form';
break;
case 'view_my_third_form':
$vars['chronoform'] = 'view_my_third_form';
break;
}
return $vars;
}
So, working so far --> URL looks like that
http://*mysite*/*lang*/*itemname*/*formname*/*token*
for example
http://www.thisisagreatsite.com/en/menu_one/view_my_form/8duswsa9hdw39jcds233w
But I'm struggling with the token. Whatever I put in the ParseRoute $vars['token'] its not parsing anything. Does maybe someone have a hint for me?
Thank you!
Not yet.
But I have checked out the tutorial here: http://docs.joomla.org/Supporting_SEF_URLs_in_your_component .
But I'm stuck at the point, where it comes to cf_uid, token or any ID. I don't know. I can pass the formname with no problems.
But I have checked out the tutorial here: http://docs.joomla.org/Supporting_SEF_URLs_in_your_component .
But I'm stuck at the point, where it comes to cf_uid, token or any ID. I don't know. I can pass the formname with no problems.
Hi,
If you have a menu item of type Chronoforms then the form link will be SEF like the link to our contact form here, I don't advise building SEF router for Chronoforms because this may have some side effects (which I can't remember now), but regarding your code, I think that the "chronoformsParseRoute" function has some problem, try to use "print_r" to check the values available in the $segments array and build your code based on that.
Regards,
Max
If you have a menu item of type Chronoforms then the form link will be SEF like the link to our contact form here, I don't advise building SEF router for Chronoforms because this may have some side effects (which I can't remember now), but regarding your code, I think that the "chronoformsParseRoute" function has some problem, try to use "print_r" to check the values available in the $segments array and build your code based on that.
Regards,
Max
Thank you for your answer. Unfortunately I couldn't get any further. When I print the arrays ->
Array ( [chronoform] => myrightform [token] => 22 )
So, both is correct, but its not working and I have no clue why. Its leading to the right form, but it's not parsing the ID somehow.
Has someone already found the solution?
Array ( [chronoform] => myrightform [token] => 22 )
So, both is correct, but its not working and I have no clue why. Its leading to the right form, but it's not parsing the ID somehow.
Has someone already found the solution?
How do you know that its not parsing the id ?
did you print the $segments or the $vars ?
Regards,
Max
did you print the $segments or the $vars ?
Regards,
Max
This topic is locked and no more replies can be posted.