Joomla.it Forum

Joomla! 4 => Joomla! 4.x => : mariarosaria 27 Apr 2023, 17:39:04

: [RISOLTO] filtro ricerca in lista categoria helix sembra non funzionare
: mariarosaria 27 Apr 2023, 17:39:04
Salve a tutti.

Ho impostato il filtro su "mese di pubblicazione" per la lista della categoria.  https://www.cittadelladellimmacolata.it/5-minuti-con-ges%C3%B9.html (https://www.cittadelladellimmacolata.it/5-minuti-con-ges%C3%B9.html)

Non dovrebbe uscire una tendina dove poter selezionare il mese?

Mi sfugge qualcosa?
Grazie
: [RISOLTO] filtro ricerca in lista categoria helix sembra non funzionare
: mariarosaria 28 Apr 2023, 21:51:27
Chiedo scusa se integro...

Giusto per capire...Per chi come me è ignorante di molte funzioni joomla...
Ho cercato a riguardo, ma non ne sono venuta a capo.

Se imposto il filtro su "mese", o "autore", o altro, è previsto che automaticamente esca una tendina con i vari "mesi", "autori" disponibili o devo in qualche modo crearla io?

Perchè che il campo di ricerca resti vuoto mi sembra assurdo. Un visitatore che vuole ricercare per autore, come fa a conoscere i nomi di tutti gli autori disponibili per effettuare la ricerca? strano  :o
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: $Red 29 Apr 2023, 20:52:28
Ciao, non conoscevo questa funzione, comunque ho provato ed a me funziona, hai provato con cassiopeia?
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: mariarosaria 30 Apr 2023, 13:14:04
Avevi ragione...Con cassiopeia funziona. Sarà helix ultimate il problema...
Cosa mi consigli di fare a questo punto?
Dovrei fare una sorta di override di helix con cassiopeia solo per l'elemento filtro?  :o
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: $Red 30 Apr 2023, 17:10:17
hai provato invece a lasciare helix e disattivare i moduli di terze parti? poi se funziona li riattivi uno alla volta per vedere con quale c'è il problema
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: mariarosaria 30 Apr 2023, 22:50:01
In quella pagina c'è soltanto il modulo di icagenda nel bottom di "estraneo".
Ho provato a disattivarlo (intendevi questo?), ma non funziona lo stesso.
Altre idee?
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: $Red 01 May 2023, 15:25:45
quindi il problema è sicuro al 99% che è con helix, non conosco quel framework, hai provato a vedere nelle impostazaioni se c'è qualche configurazione che potrebbe dare fastidio? vers. bootstrap? caricamenti di script?
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: giusebos 01 May 2023, 16:10:00
prova a rinominare la url, c'è l'accento di gesù che potrebbe dare fastidio, vedi in chiaro come si legge

https://www.cittadelladellimmacolata.it/5-minuti-con-ges%C3%B9.html



poi disabilita la cache su quelle pagine agendo sulla voce di menù padre (forse è una voce di menù nascosta)
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: mariarosaria 01 May 2023, 21:36:39
Grazie giusebos.
Ho eliminato l'accento e ripulito la cache, ma il problema non era l'accento.
Del resto con cassiopeia funzionava nonostante l'accento.
Non saprei cos'altro fare.
quindi il problema è sicuro al 99% che è con helix, non conosco quel framework, hai provato a vedere nelle impostazaioni se c'è qualche configurazione che potrebbe dare fastidio? vers. bootstrap? caricamenti di script?
Non saprei veramente dove mettere mano. Booststrap versione 5. altri script... boh, in quella pagina non c'è veramente nulla se non il calendario di icagenda...

L'unica cosa che mi viene in mente è provare a vedere se helix ha fatto qualche override della vista "lista di singola categoria", ma non sono riuscita a capire a quale file fa riferimento.

Di fatto la tendina dove scegliere il numero di articoli da visualizzare funziona, ma è l'unica. Ho provato anche a impostare il filtro su "autore" o altre voci, ma niente.
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: mariarosaria 01 May 2023, 22:20:42
Ok, ho trovato il file incriminato.
com_content/category/default_articles.php
Questo è l'override di helix
:
<?php
/**
 * @package Helix Ultimate Framework
 * @author JoomShaper https://www.joomshaper.com
 * @copyright Copyright (c) 2010 - 2021 JoomShaper
 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/

defined ('_JEXEC') or die();

require 
HelixUltimate\Framework\Platform\HTMLOverride::loadTemplate();
Questo invece il codice del file originale di cassiopeia
:
<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   (C) 2009 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\Component\ComponentHelper;
use 
Joomla\CMS\Factory;
use 
Joomla\CMS\HTML\HTMLHelper;
use 
Joomla\CMS\Language\Associations;
use 
Joomla\CMS\Language\Multilanguage;
use 
Joomla\CMS\Language\Text;
use 
Joomla\CMS\Router\Route;
use 
Joomla\CMS\Uri\Uri;
use 
Joomla\Component\Content\Administrator\Extension\ContentComponent;
use 
Joomla\Component\Content\Site\Helper\AssociationHelper;
use 
Joomla\Component\Content\Site\Helper\RouteHelper;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa $this->document->getWebAssetManager();
$wa->useScript('com_content.articles-list');

// Create some shortcuts.
$n          count($this->items);
$listOrder  $this->escape($this->state->get('list.ordering'));
$listDirn   $this->escape($this->state->get('list.direction'));
$langFilter false;

// Tags filtering based on language filter
if (($this->params->get('filter_field') === 'tag') && (Multilanguage::isEnabled()))
{
    
$tagfilter ComponentHelper::getParams('com_tags')->get('tag_list_language_filter');

    switch (
$tagfilter)
    {
        case 
'current_language':
            
$langFilter Factory::getApplication()->getLanguage()->getTag();
            break;

        case 
'all':
            
$langFilter false;
            break;

        default:
            
$langFilter $tagfilter;
    }
}

// Check for at least one editable article
$isEditable false;

if (!empty(
$this->items))
{
    foreach (
$this->items as $article)
    {
        if (
$article->params->get('access-edit'))
        {
            
$isEditable true;
            break;
        }
    }
}

$currentDate Factory::getDate()->format('Y-m-d H:i:s');
?>


<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm" class="com-content-category__articles">
    <?php if ($this->params->get('filter_field') !== 'hide') : ?>
        <div class="com-content__filter btn-group">
            <?php if ($this->params->get('filter_field') === 'tag') : ?>
                <span class="visually-hidden">
                    <label class="filter-search-lbl" for="filter-search">
                        <?php echo Text::_('JOPTION_SELECT_TAG'); ?>
                    </label>
                </span>
                <select name="filter_tag" id="filter-search" class="form-select" onchange="document.adminForm.submit();" >
                    <option value=""><?php echo Text::_('JOPTION_SELECT_TAG'); ?></option>
                    <?php echo HTMLHelper::_('select.options'HTMLHelper::_('tag.options', array('filter.published' => array(1), 'filter.language' => $langFilter), true), 'value''text'$this->state->get('filter.tag')); ?>
                </select>
            <?php elseif ($this->params->get('filter_field') === 'month') : ?>
                <span class="visually-hidden">
                    <label class="filter-search-lbl" for="filter-search">
                        <?php echo Text::_('JOPTION_SELECT_MONTH'); ?>
                    </label>
                </span>
                <select name="filter-search" id="filter-search" class="form-select" onchange="document.adminForm.submit();">
                    <option value=""><?php echo Text::_('JOPTION_SELECT_MONTH'); ?></option>
                    <?php echo HTMLHelper::_('select.options'HTMLHelper::_('content.months'$this->state), 'value''text'$this->state->get('list.filter')); ?>
                </select>
            <?php else : ?>
                <label class="filter-search-lbl visually-hidden" for="filter-search">
                    <?php echo Text::_('COM_CONTENT_' $this->params->get('filter_field') . '_FILTER_LABEL'); ?>
                </label>
                <input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" placeholder="<?php echo Text::_('COM_CONTENT_' $this->params->get('filter_field') . '_FILTER_LABEL'); ?>">
            <?php endif; ?>

            <?php if ($this->params->get('filter_field') !== 'tag' && $this->params->get('filter_field') !== 'month') : ?>
                <button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
            <?php endif; ?>
            <button type="reset" name="filter-clear-button" class="btn btn-secondary"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
        </div>
    <?php endif; ?>

    <?php if ($this->params->get('show_pagination_limit')) : ?>
        <div class="com-content-category__pagination btn-group float-end">
            <label for="limit" class="visually-hidden">
                <?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
            </label>
            <?php echo $this->pagination->getLimitBox(); ?>
        </div>
    <?php endif; ?>

    <?php if (empty($this->items)) : ?>
        <?php if ($this->params->get('show_no_articles'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_CONTENT_NO_ARTICLES'); ?>
            </div>
        <?php endif; ?>
    <?php else : ?>
        <table class="com-content-category__table category table table-striped table-bordered table-hover">
            <caption class="visually-hidden">
                <?php echo Text::_('COM_CONTENT_ARTICLES_TABLE_CAPTION'); ?>
            </caption>
            <?php if ($this->params->get('show_headings')) : ?>
                <thead>
                    <tr>
                        <th scope="col" id="categorylist_header_title">
                            <?php echo HTMLHelper::_('grid.sort''JGLOBAL_TITLE''a.title'$listDirn$listOrdernull'asc''''adminForm'); ?>
                        </th>
                        <?php if ($date $this->params->get('list_show_date')) : ?>
                            <th scope="col" id="categorylist_header_date">
                                <?php if ($date === 'created') : ?>
                                    <?php echo HTMLHelper::_('grid.sort''COM_CONTENT_' $date '_DATE''a.created'$listDirn$listOrder); ?>
                                <?php elseif ($date === 'modified') : ?>
                                    <?php echo HTMLHelper::_('grid.sort''COM_CONTENT_' $date '_DATE''a.modified'$listDirn$listOrder); ?>
                                <?php elseif ($date === 'published') : ?>
                                    <?php echo HTMLHelper::_('grid.sort''COM_CONTENT_' $date '_DATE''a.publish_up'$listDirn$listOrder); ?>
                                <?php endif; ?>
                            </th>
                        <?php endif; ?>
                        <?php if ($this->params->get('list_show_author')) : ?>
                            <th scope="col" id="categorylist_header_author">
                                <?php echo HTMLHelper::_('grid.sort''JAUTHOR''author'$listDirn$listOrder); ?>
                            </th>
                        <?php endif; ?>
                        <?php if ($this->params->get('list_show_hits')) : ?>
                            <th scope="col" id="categorylist_header_hits">
                                <?php echo HTMLHelper::_('grid.sort''JGLOBAL_HITS''a.hits'$listDirn$listOrder); ?>
                            </th>
                        <?php endif; ?>
                        <?php if ($this->params->get('list_show_votes'0) && $this->vote) : ?>
                            <th scope="col" id="categorylist_header_votes">
                                <?php echo HTMLHelper::_('grid.sort''COM_CONTENT_VOTES''rating_count'$listDirn$listOrder); ?>
                            </th>
                        <?php endif; ?>
                        <?php if ($this->params->get('list_show_ratings'0) && $this->vote) : ?>
                            <th scope="col" id="categorylist_header_ratings">
                                <?php echo HTMLHelper::_('grid.sort''COM_CONTENT_RATINGS''rating'$listDirn$listOrder); ?>
                            </th>
                        <?php endif; ?>
                        <?php if ($isEditable) : ?>
                            <th scope="col" id="categorylist_header_edit"><?php echo Text::_('COM_CONTENT_EDIT_ITEM'); ?></th>
                        <?php endif; ?>
                    </tr>
                </thead>
            <?php endif; ?>
            <tbody>
            <?php foreach ($this->items as $i => $article) : ?>
                <?php if ($this->items[$i]->state == ContentComponent::CONDITION_UNPUBLISHED) : ?>
                    <tr class="system-unpublished cat-list-row<?php echo $i 2?>">
                <?php else : ?>
                    <tr class="cat-list-row<?php echo $i 2?>" >
                <?php endif; ?>
                <th class="list-title" scope="row">
                    <?php if (in_array($article->access$this->user->getAuthorisedViewLevels())) : ?>
                        <a href="<?php echo Route::_(RouteHelper::getArticleRoute($article->slug$article->catid$article->language)); ?>">
                            <?php echo $this->escape($article->title); ?>
                        </a>
                        <?php if (Associations::isEnabled() && $this->params->get('show_associations')) : ?>
                            <div class="cat-list-association">
                            <?php $associations AssociationHelper::displayAssociations($article->id); ?>
                            <?php foreach ($associations as $association) : ?>
                                <?php if ($this->params->get('flags'1) && $association['language']->image) : ?>
                                    <?php $flag HTMLHelper::_('image''mod_languages/' $association['language']->image '.gif'$association['language']->title_native, array('title' => $association['language']->title_native), true); ?>
                                    <a href="<?php echo Route::_($association['item']); ?>"><?php echo $flag?></a>
                                <?php else : ?>
                                    <?php $class 'btn btn-secondary btn-sm btn-' strtolower($association['language']->lang_code); ?>
                                    <a class="<?php echo $class?>" title="<?php echo $association['language']->title_native?>" href="<?php echo Route::_($association['item']); ?>"><?php echo $association['language']->lang_code?>
                                        <span class="visually-hidden"><?php echo $association['language']->title_native?></span>
                                    </a>
                                <?php endif; ?>
                            <?php endforeach; ?>
                            </div>
                        <?php endif; ?>
                    <?php else : ?>
                        <?php
                        
echo $this->escape($article->title) . ' : ';
                        
$itemId Factory::getApplication()->getMenu()->getActive()->id;
                        
$link   = new Uri(Route::_('index.php?option=com_users&view=login&Itemid=' $itemIdfalse));
                        
$link->setVar('return'base64_encode(RouteHelper::getArticleRoute($article->slug$article->catid$article->language)));
                        
?>

                        <a href="<?php echo $link?>" class="register">
                            <?php echo Text::_('COM_CONTENT_REGISTER_TO_READ_MORE'); ?>
                        </a>
                        <?php if (Associations::isEnabled() && $this->params->get('show_associations')) : ?>
                            <div class="cat-list-association">
                            <?php $associations AssociationHelper::displayAssociations($article->id); ?>
                            <?php foreach ($associations as $association) : ?>
                                <?php if ($this->params->get('flags'1)) : ?>
                                    <?php $flag HTMLHelper::_('image''mod_languages/' $association['language']->image '.gif'$association['language']->title_native, array('title' => $association['language']->title_native), true); ?>
                                    <a href="<?php echo Route::_($association['item']); ?>"><?php echo $flag?></a>
                                <?php else : ?>
                                    <?php $class 'btn btn-secondary btn-sm btn-' strtolower($association['language']->lang_code); ?>
                                    <a class="<?php echo $class?>" title="<?php echo $association['language']->title_native?>" href="<?php echo Route::_($association['item']); ?>"><?php echo $association['language']->lang_code?>
                                        <span class="visually-hidden"><?php echo $association['language']->title_native?></span>
                                    </a>
                                <?php endif; ?>
                            <?php endforeach; ?>
                            </div>
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php if ($article->state == ContentComponent::CONDITION_UNPUBLISHED) : ?>
                        <div>
                            <span class="list-published badge bg-warning text-light">
                                <?php echo Text::_('JUNPUBLISHED'); ?>
                            </span>
                        </div>
                    <?php endif; ?>
                    <?php if ($article->publish_up $currentDate) : ?>
                        <div>
                            <span class="list-published badge bg-warning text-light">
                                <?php echo Text::_('JNOTPUBLISHEDYET'); ?>
                            </span>
                        </div>
                    <?php endif; ?>
                    <?php if (!is_null($article->publish_down) && $article->publish_down $currentDate) : ?>
                        <div>
                            <span class="list-published badge bg-warning text-light">
                                <?php echo Text::_('JEXPIRED'); ?>
                            </span>
                        </div>
                    <?php endif; ?>
                </th>
                <?php if ($this->params->get('list_show_date')) : ?>
                    <td class="list-date small">
                        <?php
                        
echo HTMLHelper::_(
                            
'date'$article->displayDate,
                            
$this->escape($this->params->get('date_format'Text::_('DATE_FORMAT_LC3')))
                        ); 
?>

                    </td>
                <?php endif; ?>
                <?php if ($this->params->get('list_show_author'1)) : ?>
                    <td class="list-author">
                        <?php if (!empty($article->author) || !empty($article->created_by_alias)) : ?>
                            <?php $author $article->author ?>
                            <?php $author $article->created_by_alias ?: $author?>
                            <?php if (!empty($article->contact_link) && $this->params->get('link_author') == true) : ?>
                                <?php if ($this->params->get('show_headings')) : ?>
                                    <?php echo HTMLHelper::_('link'$article->contact_link$author); ?>
                                <?php else : ?>
                                    <?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY'HTMLHelper::_('link'$article->contact_link$author)); ?>
                                <?php endif; ?>
                            <?php else : ?>
                                <?php if ($this->params->get('show_headings')) : ?>
                                    <?php echo $author?>
                                <?php else : ?>
                                    <?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY'$author); ?>
                                <?php endif; ?>
                            <?php endif; ?>
                        <?php endif; ?>
                    </td>
                <?php endif; ?>
                <?php if ($this->params->get('list_show_hits'1)) : ?>
                    <td class="list-hits">
                        <span class="badge bg-info">
                            <?php if ($this->params->get('show_headings')) : ?>
                                <?php echo $article->hits?>
                            <?php else : ?>
                                <?php echo Text::sprintf('JGLOBAL_HITS_COUNT'$article->hits); ?>
                            <?php endif; ?>
                        </span>
                    </td>
                <?php endif; ?>
                <?php if ($this->params->get('list_show_votes'0) && $this->vote) : ?>
                    <td class="list-votes">
                        <span class="badge bg-success">
                            <?php if ($this->params->get('show_headings')) : ?>
                                <?php echo $article->rating_count?>
                            <?php else : ?>
                                <?php echo Text::sprintf('COM_CONTENT_VOTES_COUNT'$article->rating_count); ?>
                            <?php endif; ?>
                        </span>
                    </td>
                <?php endif; ?>
                <?php if ($this->params->get('list_show_ratings'0) && $this->vote) : ?>
                    <td class="list-ratings">
                        <span class="badge bg-warning text-light">
                            <?php if ($this->params->get('show_headings')) : ?>
                                <?php echo $article->rating?>
                            <?php else : ?>
                                <?php echo Text::sprintf('COM_CONTENT_RATINGS_COUNT'$article->rating); ?>
                            <?php endif; ?>
                        </span>
                    </td>
                <?php endif; ?>
                <?php if ($isEditable) : ?>
                    <td class="list-edit">
                        <?php if ($article->params->get('access-edit')) : ?>
                            <?php echo HTMLHelper::_('contenticon.edit'$article$article->params); ?>
                        <?php endif; ?>
                    </td>
                <?php endif; ?>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    <?php endif; ?>

    <?php // Code to add a link to submit an article. ?>
    <?php if ($this->category->getParams()->get('access-create')) : ?>
        <?php echo HTMLHelper::_('contenticon.create'$this->category$this->category->params); ?>
    <?php endif; ?>

    <?php // Add pagination links ?>
    <?php if (!empty($this->items)) : ?>
        <?php if (($this->params->def('show_pagination'2) == 1  || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal 1)) : ?>
            <div class="com-content-category__navigation w-100">
                <?php if ($this->params->def('show_pagination_results'1)) : ?>
                    <p class="com-content-category__counter counter float-end pt-3 pe-2">
                        <?php echo $this->pagination->getPagesCounter(); ?>
                    </p>
                <?php endif; ?>
                <div class="com-content-category__pagination">
                    <?php echo $this->pagination->getPagesLinks(); ?>
                </div>
            </div>
        <?php endif; ?>
    <?php endif; ?>
    <div>
        <input type="hidden" name="filter_order" value="">
        <input type="hidden" name="filter_order_Dir" value="">
        <input type="hidden" name="limitstart" value="">
        <input type="hidden" name="task" value="">
    </div>
</form>


Come potete notare, qui (https://prnt.sc/bjMpLjZUeAg5) la vista di helix, qui (https://prnt.sc/Uk5B2pHUm2zr) quella originale di cassiopeia che potete vedere adesso se visitate la pagina.

Esteticamente mi piaceva molto più quella di helix, ma eliminando l'override il filtro funziona.

Cosa mi consigliate? Elimino l'override e cerco di ripristinare la vista con qualche css?

O posso in qualche modo combinare le regole del filtro dentro lo stesso override di helix. Non mi pare a giudicare dal codice, ma sono 0 in php
: Re:filtro mese pubblicazione lista categoria sembra non funzionare
: $Red 02 May 2023, 01:18:58
potresti provare ad individuare la parte di codice relativa al filtro o, ancora meglio, segnalarlo agli  sviluppatori di helix
: Re:[RISOLTO] filtro ricerca in lista categoria helix sembra non funzionare
: mariarosaria 02 May 2023, 17:59:53
Grazie.

Cercherò di segnalarlo agli sviluppatori di helix.
Comunque farò anche qualche altro tentativo con il codice ed eventualmente posterò una soluzione.

Per adesso, se dovesse servire a qualcuno, l'unica è eliminare dalla cartella del template helix html/com_content/category/default_articles.php

In tal modo la vista "lista singola categoria" prende il file originale del template cassiopeia e il filtro di ricerca funziona.