> For the complete documentation index, see [llms.txt](https://docs.norrnext.com/norrcompetition/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.norrnext.com/norrcompetition/customisation/link-to-contestant.md).

# Link to Contestant

When contestants submit entries to a contest, NorrCompetition can display the author's name on the entry page and link it directly to their user profile.

***

## ⚙️ Configuration Prerequisites

Before links can appear on the frontend, ensure the relevant parameters are enabled in NorrCompetition:

1. Go to **Administrator > Components > NorrCompetition > Options > Entries** (or configure at individual contest level).
2. Set **Show Contestant** to **Yes**.
3. Set **Link Contestant** to **Yes**.

{% hint style="info" %}
**Official Integration Plugin:** If you are using Community Builder, EasySocial, JomSocial, Kunena, EasyProfile, or Joomla Contacts, you do not need custom code. Simply install and configure the official [NorrCompetition Profile Link](/norrcompetition/plugins/norrcompetition-profile-link.md) plugin.
{% endhint %}

***

## 💻 Custom Plugin Implementation

If you use a custom member directory or third-party community extension, you can create a standard Joomla content plugin implementing `SubscriberInterface` and listening to `ContentPrepareEvent`.

The goal is to assign the target profile URL to `$item->submitter_link`.

### Example Plugin Class (`src/Extension/CustomProfileLink.php`)

```php
<?php

namespace MyCompany\Plugin\Content\CustomProfileLink\Extension;

\defined('_JEXEC') or die;

use Joomla\CMS\Event\Content\ContentPrepareEvent;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Router\Route;
use Joomla\Event\SubscriberInterface;
use Joomla\Registry\Registry;

final class CustomProfileLink extends CMSPlugin implements SubscriberInterface
{
    /**
     * Subscribes to Joomla content prepare events.
     *
     * @return array<string, string>
     */
    public static function getSubscribedEvents(): array
    {
        return [
            'onContentPrepare' => 'onContentPrepare',
        ];
    }

    /**
     * Prepares contestant profile link for NorrCompetition entries.
     *
     * @param   ContentPrepareEvent  $event
     * @return  void
     */
    public function onContentPrepare(ContentPrepareEvent $event): void
    {
        $context = $event->getContext();
        $item    = $event->getItem();
        $params  = $event->getParams();

        // 1. Verify context
        if ($context !== 'com_competition.participant') {
            return;
        }

        // 2. Verify component parameters require submitter link
        if (
            !($params instanceof Registry)
            || !$params->get('participant_show_submitter', 0)
            || !$params->get('participant_link_submitter', 0)
        ) {
            return;
        }

        // 3. Verify registered user ID is present
        if (empty($item->userId) || (int) $item->userId === 0) {
            return;
        }

        // 4. Assign the SEF profile URL
        $item->submitter_link = Route::_('index.php?option=com_custommember&view=profile&id=' . (int) $item->userId);
    }
}
```
