Frank Schneider Posted yesterday at 02:04 PM Posted yesterday at 02:04 PM I'm using the `$('#calendar').fullCalendar` function. One calendar for notifications and another for rentals. The notifications calendar looks as expected, but the rentals calendar doesn't; it only displays 30% horizontally. It needs to be stretched horizontally. The code is exactly the same, only the path is different. I have absolutely no idea why. Does anyone have any advice?
elabx Posted yesterday at 02:40 PM Posted yesterday at 02:40 PM That definitely looks like CSS is missing to get loaded on the first screenshot, how is it being loaded? Is this a 3rd party module?
Frank Schneider Posted yesterday at 04:01 PM Author Posted yesterday at 04:01 PM <?php if ($page->path == "/avisierungen/kalender/" || $page->path == "/vermietungen/kalender/") { ?> <script> $(function(){ 'use strict' $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay,listMonth' }, height: 'auto', contentHeight: 'auto', aspectRatio: 2.0, weekNumbers: true, navLinks: true, eventTextColor: 'black', defaultDate: '<?php echo date("Y-m-d"); ?>', editable: false, eventLimit: true, // allow "more" link when too many events events: <?php echo json_encode($calendar_data); ?> }); }); <?php } ?>
FireWire Posted 20 hours ago Posted 20 hours ago @Frank Schneider Are you rendering this calendar on the front end or in the admin? First thing I noticed was that the closing </script> tag is missing. You can use the native PHP alternate control structure syntax if this is in a mixed markup/PHP file. It's up to your personal preference but it can help readability. <?php if ($page->path == "/avisierungen/kalender/" || $page->path == "/vermietungen/kalender/"): ?> <script> $(function(){ 'use strict' $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay,listMonth' }, height: 'auto', contentHeight: 'auto', aspectRatio: 2.0, weekNumbers: true, navLinks: true, eventTextColor: 'black', defaultDate: '<?=date("Y-m-d")?>', editable: false, eventLimit: true, // allow "more" link when too many events events: <?=json_encode($calendar_data)?> }); }); </script> <?php endif ?>
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now