Ankündigung

Einklappen
Keine Ankündigung bisher.

- √ - Error when pressing on room?

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    - √ - Error when pressing on room?

    Hello.
    When i'm on the main screen, and press a button for a room, i get the following error:
    Code:
    Error accoured in twig-template engine!
    
    error: A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed.
    file:  room_sleeping.html
    line:  1
    
    --------------------------------------------------------------------------------
    I can't figure what's wrong... My rooms_menu works fine, and lists all my rooms. when i press the room the rooms_menu for that room seems like this:
    Code:
    <li data-icon="false">
    		<a href="index.php?page=room_sleeping">
    			<img class="icon"' src='{{ icon0 }}scene_making_love.png'/><h3>Soveværelse</h3>
    			<div class="ui-li-aside"></div>
    		</a>
    	</li>
    And in the room_sleeping:
    Code:
    {% extends "rooms.html" %}
    
    {% block content %}
    
    	<h1><img class="icon" src='{{ icon0 }}scene_making_love.svg' />Soveværelse</h1>
    
    	<div class="preblock">
    	</div>
    
    	<div class="block">
    		<div class="set-2" data-role="collapsible-set" data-theme="c" data-content-theme="a" data-mini="true">
    
    			<div data-role="collapsible" data-collapsed="false">
    				<h3>Licht</h3>
    
    				<div>{{ device.dimmer('licht', 'Tür dimmen', 'gaeste_licht_schalten', 'gaeste_licht_setzen') }}</div>
    			</div>
    
    			<div data-role="collapsible">
    				<h3>Einstellungen</h3>
    			</div>
    
    		</div>
    	</div>
    
    
    {% endblock %}
    I can't figure out what's the rooms.html is for, but it seems like this:
    Code:
    {% extends "base.html" %}
    
    {% block sidebar %}
    	{% include 'rooms_menu.html' %}
    {% endblock %}
    
    {% block content %}
    
    	Rooms
    
    {% endblock %}

    #2
    I really an't figure out that error... When i copy some rooms from a template, i also get that error...
    Could someone please explain the link between:

    rooms.hmtl and etc. room_bathroom.html and rooms_menu.html?

    this error is a bit annoying for me

    edit:

    Seems like it has something to do with the name of the "sub page" But isn't it only in rooms_menu it should be? And then there should be a room with the correct name?

    Kommentar


      #3
      Actually, the error message is quite self explanatory.
      Your file was saved with a BOM. That's basically a few invisible characters at the beginning of the file, which tell your text-editor about the encoding.

      I suspect that twig (the template engine in use) does not accept any content before the "extends", and the BOM is considered content.

      Please see the documentation of your editor one how to remove the BOM, and/or save the file without one.

      More on BOM: http://en.m.wikipedia.org/wiki/Byte_order_mark

      Kommentar


        #4
        Thanks... That makes good sense... The first file was one I created from scratch, the other one is a copy from a template and edited to my needs

        I'm not that good at coding yet, to see that error


        Thanks a lot

        Kommentar

        Lädt...
        X