I'm new at Joomla. I just had made my first component and module. I use _GET parameters such as 'page', 'nr' and 'q' (q contains _POST parameters in base64) because I made my own pagination. So, when I try to use it on Joomla it works fine and the url without SEF looks like this:
http://mydomain/?option=com_mycomponent&view=test&page=0&q=[base64]
But what I want is to make it friendly. I think it should something like this:
http://mydomain/component/mycomponent/view/test/page/0/q/[base64]
I enabled SEF in joomla and when I print JRequest::get('get') it just appear option and itemid parameters. What should I do to get the rest of them?
Thanks in advance.
You should define routing in your component. That should give joomla what it needs to output what you're requesting. http://docs.joomla.org/Supporting_SEF_URLs_in_your_component
There are also other SEF plugins that attempt to do this across your whole Joomla site, but they don't always work 100%.
Related
I am busy making a Joomla! component. And know i want to link to another component. So, as example i want to link from my component 'my_component' to 'his_component'. Normally this is simple to do. Just make a normal link like href="?option=com_his_component". But the problem is that one of my consumers uses SEO friendly URLs. And in that case this URL won't work.
Does anyone know a way to this the correct way (I think with the Joomla! Api)
Just wrap that link with a call to JRoute::_($url):
$link = JRoute::_('index.php?option=com_his_component&foo=bar');
I made a component and now I want to customize the link for it.
I already wrote the router.php.
The link to the component view (if I use the JRoute function of course) now looks good, except for the first part, which looks like :
http://www.example.com/en/component/componentname/...
don't mind the "en", it's there cause I use JomFish to manage more languages on my site.
I want to transform "/component/componentname/" to "/myString/" for example.
I can't use the menu for this, cause my site displays info from a database, linking this many sites to my menu is impossible.
The only solution I found requires the changing of the Joomla JRoute function (I found only a suggestion, not how it's done :( ).
What about using mod_rewrite to rewrite your url?
Basically you put the rewrite rules into your .htaccess file and Apache will handle the rest.
There is a great guide that teaches you all about it on http://www.htmlist.com/how-to/a-simplemod_rewrite-tutorial/
I have made a joomla component and wise to make the site sef. The problem is that some of the URL from the components put values by get method. so that the next page can do the task accordingly.
say
index.php?option=com_mediaonline&view=mediaonline&task=234&id=837
so that the next page will process the task accordingly, with task = 234 and id = 837. If i try to make it sef urls then nothing will work properly.
Is there any sef components or other extension available to solve this issue.
The best component for this is sh404sef, look for it in extensions.joomla.org and making the sef file for your component won't take more than 2 days
Have you not considered writing your own using a router.php file?
http://docs.joomla.org/Routing
Although sh404sef is useful I've found ACEsef to be better.
I have a custom Joomla component and a router for building my SEF URL's for use within the site, and everything is usually shiny - internally, all of my links look and act fantastic.
I recently route a controller action that sends a list of links through email, and I've noticed that my URLs are coming out.... funky - hopefully someone can tell me why.
Usually, my router generates an internal link that looks like this:
http://localhost/Registry/calendar/265889635/Some-Long-Boring-Event
However, when I send an email and preparing the same URL through the same router I get:
http://localhost/Registry/Registry/component/calendar/569555803/Some-Long-Boring-Event
Has anybody run into this issue before?
Check your Itemid GET parameter in the URL. My guess is that it's not set in the url used in emails...
I would turn off SEF URLs temporarily and get the non-SEF version of the link you want. Compare that will the URL you are using and see what is different/missing.
I'm a Joomla developer and I'am trying to build a component(in J!1.5) that uses urlparam for creating custom menu links in the admin.
I want my component to work like the built-in polls component that allows users to select the id of an item in my component.
I tried the xml file for the component but that doesn't work. But I know it's possible, Community Builder is able to use it.
Since the Joomla documentation is lacking when it comes to this feature. Can someone be so kind to give me some insight into how to use implement this in my own components?
EDIT:
To clarify: I want to know how to create an input in com_menus with the name "urlparam". From my knowledge JParameter(the components xml file) can't do this.
EDIT2:
I'll keep the above for histical purposes but to farther clarify I would like a way to link to an internal page of a custom component from a menu without having to use a external url.
Thanks.
"urlparam" Do you mean the parameters passed in the URL or is that a specific function name?
The way to retrieve HTTP url encoded parameters in Joomla is to use the class Request.
eg:
JRequest::getVar('name', 'default value');
That retrieves the parameter $_REQUEST['name'] or the 'default value' if it does not exist or evaluates to FALSE.
There are a number of helpful methods of Request that passes the value through filters for you, like JRequest::getCmd(), JRequest::getInt() etc.
If you're talking about JParameter, which is the default class for handling configurations presented in the INI or XML files, you'll find the API docs helpful.
http://api.joomla.org/Joomla-Framework/Parameter/JParameter.html
However, in actual use in components, you should retrieve parameters from JFactory::getConfig() for global parameters, or for component parameters:
$config =& JComponentHelper::getParams( 'com_name' ); // where com_name is the component name
The API wiki should also help:
http://docs.joomla.org/Framework
Why exactly can't you just you just use an External Link menu type?
This is what I do. Just give it a relative link rather than an absolute one:
index.php?option=com_components&task=blah
Presumably this isn't any different from constructing a URL to execute a command inside your component.
JRequest::getVar('name', 'default value');
Also check http://docs.joomla.org/Framework
(wanted to upvote answer 1 but wouldn't let me until I get more points.. so I'm giving the same in short answer form)