NorrCompetition | NorrNext Documentation
DocumentationNorrCompetition
  • 🚀Getting started
    • Technical Requirements
    • Installation and Updates
  • 🛠️Configuration
    • Component Options
    • General
    • Contests
    • Contest
    • Entries
    • Entry
    • Categories
    • Category
    • Images
    • Comments
    • Contest Form
    • Permissions
  • 🖼️Contests
    • Managing Contests
    • Creating Contest
    • Contest Layout Options
    • Closing Contest
  • 🏆Entries
    • Managing Entries
    • Adding Entry
    • Approving Entry
    • Entry Data Comparison
    • Entry Layout Options
    • Submitting Entry Form
    • Contestant's Profile
    • Votes Log
  • 📂Categories
    • General Information
    • Managing Categories
    • Creating Category
    • Category Layout Options
  • 🧩Fields
    • General Information
    • Managing Fields
    • Field Types
    • Creating Field
  • 🔋Modules
    • NorrCompetition Entries
    • NorrCompetition Contests
    • NorrCompetition Grid
  • 🔌Plugins
    • NorrCompetition Notifications
    • NorrCompetition Smart Search
    • NorrCompetition Search
    • NorrCompetition Sitemap
    • NorrCompetition Profile Link
    • Application for EasySocial
    • NorrCompetition Application for JomSocial
    • AUP plugin for NorrCompetition
    • NorrCompetition Image Moderation
      • Sightengine Setup
      • Plugin Configuration
  • 💬Comments
    • Integration with Facebook
    • Integration with JComments
    • Integration with Komento
    • Integration with Disqus
    • Integration with VK.com
  • ☁️Remote Storage
    • General Information
    • AWS S3
  • 🖥️Customisation
    • Template Overriding
    • Using content plugins on entry page
    • Link to contestant
    • Events
      • Content
      • Contest
      • Entry
      • Entry Form
      • Field
      • Vote
      • Other
  • ✍️Localisation
    • Language pack installation
    • How to take a part in NorrCompetition localisation
  • 📜Best Practices
    • Recommendations on image sizes
    • Use on multilingual sites
    • Tutorial: How to Create Photo/Video Voting Contest on Joomla
    • Tutorial: Monetize Voting Contests via Membership
    • Tutorial: Monetize Voting Contests via Points
    • Embedding HTML snippets on example of music contest
  • 💡FAQ
    • How the protection from unfair voting is implemented?
    • What notifications does the component send?
    • Create and edit contests on front-end
    • Submitting Entries by Unregistered Users
    • How to install sample data
    • How to change the order of tabs with comments
    • Using navigation module (breadcrumbs)
    • NorrCompetition and YOOtheme Pro
  • 🔍Troubleshooting
    • I do not get notifications from NorrCompetition
    • I get an error or white screen on photo upload
    • No images appear after submitting entries
    • Submit button is not working
  • User is not able to vote. Errors in the console
Powered by GitBook
On this page
  1. Customisation

Link to contestant

PreviousUsing content plugins on entry pageNextEvents

Last updated 11 months ago

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 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:

/**
 * 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;
}
🖥️
entry layout options