Giter Club home page Giter Club logo

calendar-bundle's Issues

external redirect will not be linked in template

Abridged reproduction:

  1. Create a new event.
  2. Set Redirect target to External URL.
  3. Set Link target to https://www.google.com/.
  4. Create an Event list module and set the Event template to event_teaser.
  5. Integrate the module somewhere in the front end.
  6. Open the front end.

The headline of the created event will not be linked. Also there will be no Read more… link. Thus you are unable to actually go the the external URL.

Tested with Contao 4.4.12. Same problem exists in Contao 3.5.31 probably.

Cause

This is caused by these lines:

// Show the teaser text of redirect events (see #6315)
if (\is_bool($event['details']))
{
    $objTemplate->hasDetails = false;
}

This is a problem for the event_teaser template, since it will only show links when hasDetails is true. The other templates like event_list or event_upcoming always create a link, regardless of hasDetails.

The current behaviour is inconsistent with the news module. In the news module, the headline is linked when it is an external redirect and the default news_latest template shows a Read more… link as well, when the news entry is an external redirect.

Make the end-time selection empty if not used

While you can leave the end-date empty you have to set a end-time to leave it open. This is confusing and not consequent. I suggest to leave the end-time empty too if it is not used!

image

If you change the start-time you every time have to set the end-time again if you want to leave it open!

Extend/improve event microdata (schema.org)

Hello Contao team,

to get the events shown in Google search results, at least the "location" field should be added with microdata, because this is a required field (from Google perspective). Currently the location is only published as plain HTML text (at least in the Demo).

Please also see the errors in the Google Structured Data Testing Tool with Contao example event page - the missing location is throwing an error.

Besides that: Is there a reason why the event pages in Contao are so... "basic"? To have a useful events component with correct microdata support, it should be possible to prepare different locations in a separate content table (to avoid duplicate content in the CMS and the microdata could be used directly from the locations entries) and also have some more fields eg for performers, door time, event status and much more, see event on schema.org with many examples... Also an option to select the type of the event would be usefull (MusicEvent, BusinessEvent, ChildrenEvent, Festival, SportsEvent...)

Or is this all ment to be added by external plugins and extensions? If so, why is the calendar and events module part of the core and not an optional module? (I'm not against the calendar module, I just want to know why it is so basic and rudimentary).

Thank you all for your great Contao work and effords!

Hide running events (Laufende Events ausblenden) has no effect

Unabhängig, ob in der Modulkonfiguration dieses Flag aktiviert ist oder nicht, werden laufende Events immer angezeigt.
Beim Format ist ansonsten eingestellt: "All upcoming events" (Alle zukünftigen Events).
Getestet unter Contao 4.4.18 und 4.5.8 in der Contao-Demo.

Endzeit wird automatisch 01:00 wen keine Zeit eingegeben wird.

Wird einer Veranstaltung eine Startzeit gegeben muss wohl auch eine Endzeit eingegeben werden.
Möchte man nun aber keine Endzeit im Frontend ausgeben löscht man den Eintrag ja wieder im Backend.
Nach dem Speichern steht dann nun aber ein 01:00 und wird auch so im Frontend als Endzeit ausgegeben.

Im Frontend erscheint nur keine Endzeit, wenn Endzeit = Startzeit.
Ist denn eine Endzeit zwingend?

Reproduzierbar in der Demo:

  • Neues Event anlegen.
  • Haken bei "Zeit hinzufügen" setzen
  • Starzeit eintragen
  • Endzeit löschen
  • speichern
  • Endzeit ansehen

Endzeit wird automatisch geleert, wenn 01:00 Uhr eingegeben wird

Wenn bei einer Veranstaltung die Endzeit auf 01:00 Uhr gesetzt wird, dann wird das nach dem Speichern einfach wieder entfernt.
Das hängt wohl hiermit zusammen:
https://github.com/contao/calendar-bundle/blob/4.x/src/Resources/contao/dca/tl_calendar_events.php#L777

Das ist echt ungünstig, da das Event nun mal leider um 01:00 Uhr endet. Also was nun machen? Kann ja schlecht einstellen, dass es dann 01:01 Uhr endet :D

Das ganze ist reproduzierbar in der Demo. Unsere Installation ist übrigens auch Contao 4.9

Loading models eagerly

Now that @fritzmg has debugged the memory issues caused by eagerly loaded models, I want to discuss eager loading in general. Take this code for example:

// Link to an article
case 'article':
if (($objArticle = \ArticleModel::findByPk($objEvent->articleId, array('eager'=>true))) !== null && ($objPid = $objArticle->getRelated('pid')) instanceof PageModel)
{
/** @var PageModel $objPid */
self::$arrUrlCache[$strCacheKey] = ampersand($objPid->getFrontendUrl('/articles/' . ($objArticle->alias ?: $objArticle->id)));
}
break;

With array('eager'=>true) we instruct Contao to also load all related models. Here's what we get:

  • ArticleModel
  • PageModel (pid)
  • UserModel (author)

However, we are not using the UserModel in this case, so we would not have needed to create it. On the other hand, using array('eager'=>true) has saved us one additional database query.

@contao/developers Would you prefer having more database queries and no unneeded models over having less database queries and potentially unneeded models?

Make it possible to highlight events like news

In the news module you can star out/highlight news but not in the event module.

The highlighting feature is a great feature to show specific items of an archive on a page like the homepage for example. Why not use this advantage for higlighting events at a specific page?

Tag calendar and event in 4.6

Here's the page example. Should be added on bothtl_calendar and tl_calendar_event, imho.

// Tag the response
if (System::getContainer()->has('fos_http_cache.http.symfony_response_tagger'))
{
    /** @var ResponseTagger $responseTagger */
    $responseTagger = System::getContainer()->get('fos_http_cache.http.symfony_response_tagger');
    $responseTagger->addTags(array('contao.db.tl_page.' . $objPage->id));
}

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.