# Link to contestant

To make a link to a user who has submitted an entry for contest, you need to create a content plugin for `onContentPrepare` event.

In [entry layout options](https://docs.norrnext.com/norrcompetition/configuration/entry) the parameter *Contestant* should be enabled, as well as *Link Contestant*.

The idea is to set `submitter_link` property for entry object. Here is an example of `onContentPrepare` code:

```php
/**
 * Retrieves the link for contestant.
 *
 * @param   string   $context  The context of the content being passed to the plugin.
 * @param   mixed    &$item    An entry object.
 * @param   object   $params   Component parameters.
 * @param   integer  $page     Optional page number. Unused. Defaults to zero.
 *
 * @return  boolean
 */
public function onContentPrepare($context, &$item, $params, $page = 0)
{
	// Check for valid context
	if ($context != 'com_competition.participant')
	{
		return true;
	}

	// Return if we don't have valid params or don't show/link to the contestant
	if (!($params instanceof Joomla\Registry\Registry)
		|| !$params->get('participant_show_submitter')
		|| !$params->get('participant_link_submitter'))
	{
		return true;
	}

	// Return if we don't have a valid submitter id
	if (!isset($item->userId) || !(int) $item->userId)
	{
		return true;
	}

	// Set the link to submitter
	$item->submitter_link = JRoute::_('index.php?option=com_somecomponent&profile=' . $item->userId);

	return true;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.norrnext.com/norrcompetition/customisation/link-to-contestant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
