Git Product home page Git Product logo

calendarize_pages's Introduction

Hi there 👋

My name is Tim and I am a PHP backend developer working for HDNET in Werther, Germany.

Some facts...

  • 🔭 I’m currently working on TYPO3 Extensions.
  • 🌱 I’m currently learning A-Frame.io for VR features.
  • 🤔 I’m looking for help with game design in TypeScript/A-Frame.io.
  • 💬 Ask me anything about TYPO3.
  • 📫 Your reach me via GitHub.
  • ⚡ Fun fact: I love playing games in the garden -> My Games

calendarize_pages's People

Contributors

artus70 avatar garbast avatar lochmueller avatar okmiim avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

calendarize_pages's Issues

Usage of calendarize data on a page

Hi!

Is there something prepared or any concept how to output the calendarize information (date, time, organizer, location, etc.) on a page?

Thx!

Feature: Add {page.categories} object to fluid template

At the moment I can't output system categories assigned to a web page in the fluid template. {page.categories} does not exist - can this be added so that the categories can be output in the frontend?

(Tested unsuccessfully with <f:debug>{page}</debug>.)

showing calendarized pages in list view depending on page category does not work

Showing and linking pages in calendarize list view works great, but only if the calendarize plugin has no categories assigned! When filtering by using categories, the categories of the calendarized pages (which actually match the plugin category setting) are not recognized, so no pages are listed then.

Does calendarize_pages need some additional search functionality to make that work? (Unfortunately, I don't know enough about plug-in programming to do this myself.)

New Page Type

  • Create a new page type (in this case calendarize is required) - like EXT:blog
  • Cofniguration for "Separate pagetype" or every normal page

intExplode on NULL

Field calendarize has NULL as default value
Bildschirm­foto 2023-09-25 um 11 24 31

On installations with translations an error occurs when saving a translated page without calendarize items.

https://github.com/lochmueller/calendarize/blob/bff41ea4725a90d9b1f57d0a3baf26c7d59dca2c/Classes/Service/IndexPreparationService.php#L56

$fieldName equals 'calendarize', $rawOriginalRecord[$fieldName] is NULL

Error message:
Passing null to parameter #2 ($string) of type string is deprecated

Setup:
TYPO3 11.5.30
Calendarize 12.4.4
CalendarizePages 3.3.0
PHP 8.2
'exceptionalErrors' => 12290

Remove calendarized Pages from add buttons in module view

It does not make much sense that buttons for calendarized pages are also offered in web->Calendarize. Clicking on them creates a subordinate web page that otherwise has nothing to do with the page clicked on.

Moreover, the list of blue buttons is insanely growing with every new calendarized page being created.

I suggest removing "CalendarizePages" here completely.

grafik

Filter calendarized pages

Prerequisites:

  1. typo3 10.4.14
  2. calendarized pages 2.0.0

Description:

Seems that Full text search for calendarized pages does not work.
When i try to do a search with Calendarize search plugin, only the dates are taken into account but not the fullText input

Suggested fix:
For obtain the correct filter i think something like this code should work:

  1. add a PageRepository class
namespace HDNET\CalendarizePages\Domain\Repository;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Persistence\Repository;
use TYPO3\CMS\Extbase\Persistence\Generic\Query;
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface;
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\Comparison;

/**
 * Repository for Page models.
 */
class PageRepository extends Repository
{
	/**
     * Get the IDs of the given search term.
     *
     * @param string $searchTerm
     *
     * @return array
     */
     public function getIdsBySearchTerm($searchTerm)
    {
        $query = $this->createQuery();
        $constraint = $this->getConstraintForSearchWord($query, $searchTerm);
        $query->matching($query->logicalOr($constraint));
        $rows = $query->execute(true);

        $ids = [];
        foreach ($rows as $row) {
            $ids[] = (int)$row['uid'];
        }

        return $ids;
    }
	
    protected function getConstraintForSearchWord(QueryInterface $query, string $searchWord): OrInterface
    {
        $logicalOrConstraints = [
            $query->like('title', '%' . $searchWord . '%'),
            $query->like('abstract', '%' . $searchWord . '%'),
            $query->like('description', '%' . $searchWord . '%'),
        ];

        return $query->logicalOr($logicalOrConstraints);
    }
}
  1. add a new slot
/**
 * Event search service.
 */
declare(strict_types=1);

namespace HDNET\CalendarizePages\Slots;

use HDNET\CalendarizePages\Domain\Repository\PageRepository;
use HDNET\Autoloader\Annotation\SignalClass;
use HDNET\Autoloader\Annotation\SignalName;
use HDNET\Calendarize\Domain\Model\PluginConfiguration;
use HDNET\Calendarize\Domain\Repository\EventRepository;
use HDNET\Calendarize\Register;
use HDNET\Calendarize\Utility\HelperUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;

/**
 * Event search service.
 */
class EventSearch
{
    /**
     * Check if we can reduce the amount of results.
     *
     * @SignalClass(value="HDNET\Calendarize\Domain\Repository\IndexRepository")
     * @SignalName(value="findBySearchPre")
     *
     * @param array          $indexIds
     * @param \DateTime|null $startDate
     * @param \DateTime|null $endDate
     * @param array          $customSearch
     * @param array          $indexTypes
     * @param bool           $emptyPreResult
     * @param array          $additionalSlotArguments
     *
     * @return array|void
     */
    public function setIdsByCustomSearch(
        array $indexIds,
        \DateTime $startDate = null,
        \DateTime $endDate = null,
        array $customSearch = [],
        array $indexTypes = [],
        bool $emptyPreResult = false,
        array $additionalSlotArguments = []
    ) {
        if (!\in_array($this->getUniqueRegisterKey(), $indexTypes, true)) {
            return;
        }

        if (!isset($customSearch['fullText']) || !$customSearch['fullText']) {
            return;
        }

        $pageRepository = GeneralUtility::makeInstance(ObjectManager::class)->get(PageRepository::class);
        $searchTermHits = $pageRepository->getIdsBySearchTerm($customSearch['fullText']);
        if ($searchTermHits && \count($searchTermHits)) {
            $indexIds['pages'] = $searchTermHits;
        }


        return [
            'indexIds' => $indexIds,
            'startDate' => $startDate,
            'endDate' => $endDate,
            'customSearch' => $customSearch,
            'indexTypes' => $indexTypes,
            'emptyPreResult' => $emptyPreResult,
            'additionalSlotArguments' => $additionalSlotArguments,
        ];
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.