<script>
    jQuery(window).load(function(){
        jQuery('#modal{{modalid}}').modal('show');
        jQuery('#modal{{modalid}}Button').click(function() {
            history.replaceState(null, "{{title}}", "{{url}}");
            window.location.href = '{{url}}';
        });
    });
 </script>
 
 <div class="modal fade in" id="modal{{modalid}}" tabindex="-1" role="dialog" aria-labelledby="modal{{modalid}}Label" aria-hidden="true"  data-backdrop="static" data-keyboard="false">
   <div class="modal-dialog modal-dialog-centered" role="document">
     <div class="modal-content">
       <div class="modal-header">
         <h2 class="modal-title" id="modal{{modalid}}Label"><i class="fas fa-times"></i> Fehler</h2>
       </div>
       <div class="modal-body">
          <p class="mb-0">
            Sie haben keine Berechtigung diese Seite zu sehen!
          </p>
       </div>
       <div class="modal-footer">
         <button id="modal{{modalid}}Button" type="button" class="btn btn-primary" data-dismiss="modal">Zur Startseite</button>
       </div>
     </div>
   </div>
 </div>