user142006
user142006

Reputation: 119

Link to an internal page of a custom component in Joomla 1.5

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.

Upvotes: 0

Views: 2732

Answers (3)

relativityboy
relativityboy

Reputation: 21

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)

Upvotes: 0

nedned
nedned

Reputation: 3707

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.

Upvotes: 0

bucabay
bucabay

Reputation: 5295

"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

Upvotes: 1

Related Questions