-
-
Notifications
You must be signed in to change notification settings - Fork 213
Discrepancy with $this->date between EventReader and EventList #8012
Comments
Although this is easy to fix, I wonder if the problem will ever really occur. If you chose any |
@contao/developers /cc |
Unifying the templates would certainly be a good thing, but I wouldn't consider this a bugfix… |
It is a bugfix without a doubt. The question is if this case will ever really occur, because if you chose any |
That's what I mean. Fixing the date only does not make sense for the moment. Adjusting the reader and list so all templates work with all modules makes sense, but I would not consider that a bugfix. |
It does not make sense at all, because a list template has different requirements than a reader template! |
In my opinion both show an event. Maybe people want to show the full event details in a list. |
Happened often to me. |
I it really happened often, you would have noticed that it is not possible :) |
@Toflar @aschempp The problem isn't using the event_full template in an event list (this won't cause any invalid html at least), but the other way around. However, I also think it's very rare that someone wants to use the event_list template in the event reader. I would consider it a known limitation right now and maybe fix it for Contao 5? |
Well one just needs to rewrite the template in that case. Guess we always did that :D |
No, I guess you never had this case before. See @fritzmg's comment to understand which case we are discussing:
|
Fixed in a6c674f. |
How do we handle date ranges (e.g. 25/11/2015 – 30/11/2015)? We might want to mark up the date/time with two separate <time datetime="2015-11-25">25/11/2015</time> – <time datetime="2015-11-30">30/11/2015</time> |
That would be wrong, because the |
Hmm: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
I can't see any reason why it should not be used multiple times? |
It can be used multiple times but it should not be used for both the event start date and end date without additional markup such as schema.org. |
Ok, so how about we add that markup? Would make sense anyway? |
Yes, but that's a separate ticket then (feature request in https://github.com/contao/calendar-bundle). We will have to add some more variables to the template and move all of this logic to the template. Not nice but possible. |
All the event templates use the variable
$this->date
. However, the Event modules do not fill this variable with the same values. While the EventList module fills this variable with just the date, e.g.2015-09-14
the EventReader module on the other hand fills this variable with the date wrapped within an HTML<time>
tag, e.g.So, if you select the default event_list template in the EventReader (for whatever reason) it will produce invalid HTML:
This is also reproducible in the Contao Online Demo.
The reason why the EventReader module produces a different value for
$this->date
is probably because the default event_full template has this line in it:which in the end will produce
But in the teaser and list template, the variable is used within the title attribute of the link.
See also 3.5.3 Event Reader zeigt nur Teaserinhalt und seltsame Zeichen
The text was updated successfully, but these errors were encountered: