Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Content

Content and form events in NorrCompetition leverage core Joomla 5 event classes. These events allow plugins to manipulate XML form structures before display and render custom markup on entry pages.


onContentPrepareForm

  • Event Class: \Joomla\CMS\Event\Model\PrepareFormEvent

  • Triggered In: Form models during loadForm() in backend and frontend.

Description

Triggered whenever a form definition is loaded. Plugins can inject custom XML fields, manipulate fieldsets, or alter field attributes conditionally before the form renders.

use Joomla\CMS\Event\Model\PrepareFormEvent;

public function onContentPrepareForm(PrepareFormEvent $event): void
{
    $form = $event->getForm();
    $data = $event->getData();

    // Check target form context
    if ($form->getName() !== 'com_competition.appform') {
        return;
    }

    // Load custom XML definitions or alter existing fields
    $form->load('<?xml version="1.0" encoding="utf-8"?><form><fieldset name="custom"><field name="my_extra" type="text" label="Extra Field" /></fieldset></form>');
}

Available Form Contexts:

  • com_competition.competition — Backend contest edit form

  • com_competition.participant — Backend participant entry edit form

  • com_competition.category — Category edit form

  • com_competition.field — Custom field edit form

  • com_competition.appform — Frontend entry submission form

  • com_competition.cform — Frontend contest creation form


onContentPrepare

  • Event Class: \Joomla\CMS\Event\Content\ContentPrepareEvent

  • Context: com_competition.participant

  • Triggered In: Frontend Entry view (site/src/View/Participant/HtmlView.php)

Description

Allows plugins to process text shortcodes or enrich the entry object before rendering. Commonly used to parse plugin tags (e.g., {youtube}, {loadposition}) or generate links to contestant profiles.


onContentAfterTitle

  • Event Class: \Joomla\CMS\Event\Content\ContentAfterTitleEvent

  • Context: com_competition.participant

  • Triggered In: Entry layout right after the title heading

Description

Returns HTML content to display immediately beneath the entry's main title (e.g., social share buttons, author badges, rating stars).


onContentBeforeDisplay

  • Event Class: \Joomla\CMS\Event\Content\ContentBeforeDisplayEvent

  • Context: com_competition.participant

  • Triggered In: Entry layout directly above the media gallery / main body

Description

Returns HTML content to render above the primary entry media container.


onContentAfterDisplay

  • Event Class: \Joomla\CMS\Event\Content\ContentAfterDisplayEvent

  • Context: com_competition.participant

  • Triggered In: Entry layout directly below the main body content

Description

Returns HTML markup rendered below the main entry body and custom fields (e.g., donation widgets, sponsor banners, related entry sliders).

Last updated