Come creare un sito web per conferenze con Joomla Core - Parte 2

Dettagli della notizia

Nella prima parte di questo articolo ho scritto circa la pianificazione sul sito web della conferenza. Ho descritto i tipi di contenuto e le funzionalità che vogliamo avere. Ora ti mostrerò cosa succede dopo che uno speaker ha presentato un discorso.

Contenuto

Come ho scritto nel Articolo precedente i discorsi presentati sono archiviati come NON PUBBLICATI nella categoria "Discorsi". Gli speaker vengono reindirizzati a una pagina "di ringraziamento" con alcune informazioni e gli amministratori ricevono un'e-mail che informa della nuova presentazione (questa funzione è presente nel plugin "Content - Joomla").

Tra qualche mese il team siederà insieme e deciderà quali discorsi faranno parte del programma della conferenza. Saranno pubblicati i discorsi/articoli accettati e anche lo speaker/contatto corrispondente. Il team informerà gli speaker e saranno in grado di modificare la loro voce di contatto.

Quando gli speaker accedono alla pagina, vedranno quanto segue:

Screenshot della mia pagina

  • Discorsi accettati: Modulo Articoli che mostra solo il titolo degli articoli nella categoria discorsi filtrati dall'utente corrente

Filtro nel modulo articolo

  • Il mio profilo di speaker: si tratta di un modulo dedicato che elenca i contatti associati all'utente corrente. Il link rimanda direttamente alla scheda del contatto, che può essere modificata per aggiungere una foto, una descrizione e alcune informazioni aggiuntive.

Vista dello speaker

Il modulo di modifica per il contatto è stato semplificato con un override simile al modulo di modifica per il contenuto (spiegato nell'articolo precedente):

<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Contact\Administrator\Helper\ContactHelper;
use Joomla\Component\Contact\Site\Helper\RouteHelper;

/** @var \Joomla\Component\Contact\Site\View\Category\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('core');

$canDo   = ContactHelper::getActions('com_contact', 'category', $this->category->id);
$canEdit = $canDo->get('core.edit');
$userId  = $this->getCurrentUser()->id;

$showEditColumn = false;
if ($canEdit) {
    $showEditColumn = true;
} elseif ($canDo->get('core.edit.own') && !empty($this->items)) {
    foreach ($this->items as $item) {
        if ($item->created_by == $userId) {
            $showEditColumn = true;
            break;
        }
    }
}

$listOrder  = $this->escape($this->state->get('list.ordering'));
$listDirn   = $this->escape($this->state->get('list.direction'));
?>
<div class="com-contact-category__items">
        <?php if (empty($this->items)) : ?>
            <?php if ($this->params->get('show_no_contacts', 1)) : ?>
                <div class="alert alert-info">
                    <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
                    <?php echo Text::_('COM_CONTACT_NO_CONTACTS'); ?>
                </div>
            <?php endif; ?>

        <?php else : ?>

            <div class="com-contact row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 gy-3" id="contactList">

                <?php foreach ($this->items as $i => $item) : ?>
                    <?php if ($this->items[$i]->published == 0) : ?>
                        <div class="system-unpublished col">
                    <?php else : ?>
                        <div class="col" >
                    <?php endif; ?>

                        <?php if ($canEdit || ($canDo->get('core.edit.own') && $item->created_by === $userId)) : ?>
                            <div>
                                <?php echo HTMLHelper::_('contacticon.edit', $item, $this->params); ?>
                            </div>
                        <?php endif; ?>

                        <?php if ($item->published == 0) : ?>
                            <div>
                                <span class="list-published badge bg-warning text-light">
                                    <?php echo Text::_('JUNPUBLISHED'); ?>
                                </span>
                            </div>
                        <?php endif; ?>

                        <?php if ($item->publish_up && strtotime($item->publish_up) > strtotime(Factory::getDate())) : ?>
                            <div>
                                <span class="list-published badge bg-warning text-light">
                                    <?php echo Text::_('JNOTPUBLISHEDYET'); ?>
                                </span>
                            </div>
                        <?php endif; ?>

                        <?php if (!is_null($item->publish_down) && strtotime($item->publish_down) < strtotime(Factory::getDate())) : ?>
                            <div>
                                <span class="list-published badge bg-warning text-light">
                                    <?php echo Text::_('JEXPIRED'); ?>
                                </span>
                            </div>
                        <?php endif; ?>

                        <?php if ($item->published == -2) : ?>
                            <div>
                                <span class="badge bg-warning text-light">
                                    <?php echo Text::_('JTRASHED'); ?>
                                </span>
                            </div>
                        <?php endif; ?>

                        <div class="com-contact-single card">
                            <?php if ($this->params->get('show_image_heading')) : ?>
                                <?php if ($item->image) : ?>
                                    <?php echo LayoutHelper::render(
                                        'joomla.html.image',
                                        [
                                            'src'   => $item->image,
                                            'alt'   => $this->escape($item->name),
                                            'class' => 'contact-thumbnail rounded-top-2 mb-3',
                                        ]
                                    ); ?>
                                <?php else : ?>
                                    <?php echo LayoutHelper::render(
                                        'joomla.html.image',
                                        [
                                            'src'   => 'images/design/placeholder.png',
                                            'alt'   => $this->escape($item->name),
                                            'class' => 'contact-thumbnail rounded-top-2 mb-3',
                                        ]
                                    ); ?>
                                <?php endif; ?>
                            <?php endif; ?>
                            <div class="px-2 d-flex flex-column align-items-center">
                                <h2>
                                    <a href="/<?php echo Route::_(RouteHelper::getContactRoute($item->slug, $item->catid, $item->language)); ?> " class="stretched-link">
                                        <?php echo $this->escape($item->name); ?>
                                    </a>
                                </h2>

                                <?php echo $item->event->afterDisplayTitle; ?>

                                <?php echo $item->event->beforeDisplayContent; ?>

                                <?php if ($this->params->get('show_position_headings') && !empty($item->con_position)) : ?>
                                    <p><?php echo $item->con_position; ?></p>
                                <?php endif; ?>

                                <?php if ($this->params->get('show_country_headings') && !empty($item->country)) : ?>
                                    <p><?php echo $item->country; ?></p>
                                <?php endif; ?>

                                <?php echo $item->event->afterDisplayContent; ?>
                            </div>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        <?php endif; ?>

        <?php if ($canDo->get('core.create')) : ?>
            <?php echo HTMLHelper::_('contacticon.create', $this->category, $this->category->params); ?>
        <?php endif; ?>

        <?php if ($this->params->get('show_pagination', 2)) : ?>
            <div class="com-contact-category__pagination w-100">
                <?php if ($this->params->def('show_pagination_results', 1)) : ?>
                    <p class="com-contact-category__counter counter float-end pt-3 pe-2">
                        <?php echo $this->pagination->getPagesCounter(); ?>
                    </p>
                <?php endif; ?>

                <?php echo $this->pagination->getPagesLinks(); ?>
            </div>
        <?php endif; ?>
</div>

Per evitare confusioni abbiamo installato il plugin "Restricted FS" (https://restrictedfs.dgrammatiko.dev/) che limita il caricamento delle immagini in una cartella specifica per utente.

Per gli speaker abbiamo preparato alcune modifiche. Per la vista categoria:

Vista degli speaker

Override di default _items.php

<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Contact\Administrator\Helper\ContactHelper;
use Joomla\Component\Contact\Site\Helper\RouteHelper;

/** @var \Joomla\Component\Contact\Site\View\Category\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('core');

$canDo   = ContactHelper::getActions('com_contact', 'category', $this->category->id);
$canEdit = $canDo->get('core.edit');
$userId  = $this->getCurrentUser()->id;

$showEditColumn = false;
if ($canEdit) {
    $showEditColumn = true;
} elseif ($canDo->get('core.edit.own') && !empty($this->items)) {
    foreach ($this->items as $item) {
        if ($item->created_by == $userId) {
            $showEditColumn = true;
            break;
        }
    }
}

$listOrder  = $this->escape($this->state->get('list.ordering'));
$listDirn   = $this->escape($this->state->get('list.direction'));
?>
<div class="com-contact-category__items">
        <?php if (empty($this->items)) : ?>
            <?php if ($this->params->get('show_no_contacts', 1)) : ?>
                <div class="alert alert-info">
                    <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
                    <?php echo Text::_('COM_CONTACT_NO_CONTACTS'); ?>
                </div>
            <?php endif; ?>

        <?php else : ?>

            <div class="com-contact row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-lg-4 gy-3 mb-2" id="contactList">

                <?php foreach ($this->items as $i => $item) : ?>
                    <?php if ($this->items[$i]->published == 0) : ?>
                        <div class="system-unpublished col">
                    <?php else : ?>
                        <div class="col" >
                    <?php endif; ?>

                        <div class="com-contact-single card">
                            <?php if ($this->params->get('show_image_heading')) : ?>
                                <?php if ($item->image) : ?>
                                    <?php echo LayoutHelper::render(
                                        'joomla.html.image',
                                        [
                                            'src'   => $item->image,
                                            'alt'   => $this->escape($item->name),
                                            'class' => 'contact-thumbnail rounded-top-2 mb-3',
                                        ]
                                    ); ?>
                                <?php else : ?>
                                    <?php echo LayoutHelper::render(
                                        'joomla.html.image',
                                        [
                                            'src'   => 'images/design/placeholder.png',
                                            'alt'   => $this->escape($item->name),
                                            'class' => 'contact-thumbnail rounded-top-2 mb-3',
                                        ]
                                    ); ?>
                                <?php endif; ?>
                            <?php endif; ?>
                            <div class="px-2 d-flex flex-column align-items-center">
                                <h2>
                                    <a href="/<?php echo Route::_(RouteHelper::getContactRoute($item->slug, $item->catid, $item->language)); ?> " class="stretched-link">
                                        <?php echo $this->escape($item->name); ?>
                                    </a>
                                </h2>

                                <?php echo $item->event->afterDisplayTitle; ?>

                                <?php echo $item->event->beforeDisplayContent; ?>

                                <?php if ($this->params->get('show_position_headings') && !empty($item->con_position)) : ?>
                                    <p><?php echo $item->con_position; ?></p>
                                <?php endif; ?>

                                <?php if ($this->params->get('show_country_headings') && !empty($item->country)) : ?>
                                    <p><?php echo $item->country; ?></p>
                                <?php endif; ?>

                                <?php echo $item->event->afterDisplayContent; ?>

                                <?php if ($canEdit || ($canDo->get('core.edit.own') && $item->created_by === $userId)) : ?>
                                    <div>
                                        <?php echo HTMLHelper::_('contacticon.edit', $item, $this->params); ?>
                                    </div>
                                <?php endif; ?>

                                <?php if ($item->published == 0) : ?>
                                    <div>
                                        <span class="list-published badge bg-warning text-light">
                                            <?php echo Text::_('JUNPUBLISHED'); ?>
                                        </span>
                                    </div>
                                <?php endif; ?>

                                <?php if ($item->publish_up && strtotime($item->publish_up) > strtotime(Factory::getDate())) : ?>
                                    <div>
                                        <span class="list-published badge bg-warning text-light">
                                            <?php echo Text::_('JNOTPUBLISHEDYET'); ?>
                                        </span>
                                    </div>
                                <?php endif; ?>

                                <?php if (!is_null($item->publish_down) && strtotime($item->publish_down) < strtotime(Factory::getDate())) : ?>
                                    <div>
                                        <span class="list-published badge bg-warning text-light">
                                            <?php echo Text::_('JEXPIRED'); ?>
                                        </span>
                                    </div>
                                <?php endif; ?>

                                <?php if ($item->published == -2) : ?>
                                    <div>
                                        <span class="badge bg-warning text-light">
                                            <?php echo Text::_('JTRASHED'); ?>
                                        </span>
                                    </div>
                                <?php endif; ?>

                            </div>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        <?php endif; ?>

        <?php if ($canDo->get('core.create')) : ?>
            <?php echo HTMLHelper::_('contacticon.create', $this->category, $this->category->params); ?>
        <?php endif; ?>

        <?php if ($this->params->get('show_pagination', 2)) : ?>
            <div class="com-contact-category__pagination w-100">
                <?php if ($this->params->def('show_pagination_results', 1)) : ?>
                    <p class="com-contact-category__counter counter float-end pt-3 pe-2">
                        <?php echo $this->pagination->getPagesCounter(); ?>
                    </p>
                <?php endif; ?>

                <?php echo $this->pagination->getPagesLinks(); ?>
            </div>
        <?php endif; ?>
</div>

E per il contatto:

Vista dello speaker

Override di default.php:

<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Contact\Site\Helper\RouteHelper;


/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
$tparams = $this->item->params;
$canDo   = ContentHelper::getActions('com_contact', 'category', $this->item->catid);
$canEdit = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by === $this->getCurrentUser()->id);
$htag    = $tparams->get('show_page_heading') ? 'h2' : 'h1';
$htag2   = ($tparams->get('show_page_heading') && $tparams->get('show_name')) ? 'h3' : 'h2';
$icon    = $this->params->get('contact_icons') == 0;
?>

<div class="com-contact contact">
    <?php if ($tparams->get('show_page_heading')) : ?>
        <h1>
            <?php echo $this->escape($tparams->get('page_heading')); ?>
        </h1>
    <?php endif; ?>

    <?php if ($this->item->name && $tparams->get('show_name')) : ?>
        <div class="page-header">
            <<?php echo $htag; ?>>
                <?php if ($this->item->published == 0) : ?>
                    <span class="badge bg-warning text-light"><?php echo Text::_('JUNPUBLISHED'); ?></span>
                <?php endif; ?>
                <span class="contact-name"><?php echo $this->item->name; ?></span>
            </<?php echo $htag; ?>>
        </div>
    <?php endif; ?>

    <?php if ($canEdit) : ?>
        <div class="icons">
            <div class="float-end">
                <div>
                    <?php echo HTMLHelper::_('contacticon.edit', $this->item, $tparams); ?>
                </div>
            </div>
        </div>
    <?php endif; ?>

    <?php echo $this->item->event->afterDisplayTitle; ?>

    <?php if ($tparams->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
        <div class="com-contact__tags">
            <?php $this->item->tagLayout = new FileLayout('joomla.content.tags'); ?>
            <?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
        </div>
    <?php endif; ?>

    <?php echo $this->item->event->beforeDisplayContent; ?>

    <?php if ($this->params->get('show_info', 1)) : ?>
        <div class="row mb-5">

            <?php if ($this->item->image && $tparams->get('show_image')) : ?>
                <div class="col-sm-4">
                    <?php echo LayoutHelper::render(
                        'joomla.html.image',
                        [
                            'src'      => $this->item->image,
                            'alt'      => $this->item->name,
                            'class'    => 'rounded-2',
                        ]
                    ); ?>
                </div>
            <?php endif; ?>
            <div class="col-sm-8">
                <p><?php echo $this->item->country; ?></p>
                <?php if ($this->item->con_position && $tparams->get('show_position')) : ?>
                    <p><?php echo $this->item->con_position; ?></p>
                <?php endif; ?>

                <?php if ($this->item->misc && $tparams->get('show_misc')) : ?>
                    <?php echo $this->item->misc; ?>
                <?php endif; ?>
            </div>
        </div>

    <?php endif; ?>

    <?php if ($tparams->get('show_articles') && $this->item->user_id && $this->item->articles) : ?>
        <?php echo '<' . $htag2 . '>' . Text::_('JWC_TALKS') . '</' . $htag2 . '>'; ?>

        <?php echo $this->loadTemplate('articles'); ?>
    <?php endif; ?>

    <?php if ($tparams->get('show_profile') && $this->item->user_id && PluginHelper::isEnabled('user', 'profile')) : ?>
        <?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_PROFILE') . '</' . $htag2 . '>'; ?>

        <?php echo $this->loadTemplate('profile'); ?>
    <?php endif; ?>

    <?php if ($tparams->get('show_user_custom_fields') && $this->contactUser) : ?>
        <?php echo $this->loadTemplate('user_custom_fields'); ?>
    <?php endif; ?>

    <?php echo $this->item->event->afterDisplayContent; ?>
</div>

I discorsi (articoli) dello speker sono elencati sotto il profilo. Ciò è possibile impostando il parametro "User Articles" su "Show" nella voce di menu:

Parametri voce menu

Il titolo "My talk(s) è un override di lingua:

Screenshot dell'override di lingua

Il programma della conferenza sarà anche creato utilizzando Joomla Core. Come? Questo sarà l'argomento del mio prossimo articolo ;-)

Non dimenticare di visitare il sito web della conferenza: https://conference.joomla.org/. Pensate di entrare a far parte della comunità internazionale Joomla nel mese di ottobre e se avete qualcosa di speciale di cui parlare, si prega di inviare la vostra sessione!

Alcuni articoli pubblicati sulla rivista Joomla Community Magazine rappresentano l'opinione personale o l'esperienza dell'autore su un argomento specifico e potrebbero non essere in linea con la posizione ufficiale del progetto Joomla.

Informazioni Articolo

Categoria:
Traduzioni Joomla Magazine
Autore:
Viviana Menzel
Pubblicato:
25 Marzo 2026
Visualizzazioni:
502
Traduttore:
Gioacchino Cipriano
Note del traduttore:

Prestare attenzione a voci tradotte che potrebbero essere presente nel codice php per l'override

Link Articolo Originale:
https://magazine.joomla.org/all-issues/march-2026/how-to-create-a-conference-website
Livello Difficoltà:
Esperto
Versioni di Joomla:
Joomla 5.x Joomla 6.x

Altri articoli della stessa categoria