We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7571
    • 135 Posts
    Доброго времени суток!
    Столкнулся с проблемой валидацией, а может и не с проблемой, так как только недавно начал использовать modx.
    Modx создает очень много дополнительных дивов и т.п. если смотреть исходный код из браузера, особенно если использовать сниппеты галлереии и т.д.
    Вот, например, мои ошибки при валидации:

    Validation Output: 3 Errors
    
       1. Error Line 100, Column 27: document type does not allow element "style" here
    
              <style type="text/css">
    
          ✉
    
          The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
    
          One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
       2. Error Line 104, Column 78: end tag for "img" omitted, but OMITTAG NO was specified
    
              <img src="assets/modules/easy2/templates/default/icons/error.png" alt="">
    
          ✉
    
          You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
       3. Info Line 104, Column 5: start tag was here
    
              <img src="assets/modules/easy2/templates/default/icons/error.png" alt="">
    
       4. Error Line 149, Column 7: end tag for "ul" which is not finished
    
            </ul>
    
          ✉
    
          Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>
    
          Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists require appropriate list items (<ul> and <ol> require <li>; <dl> requires <dt> and <dd>), and so on.
    

    Открыл исходный код, но на указанных строках, не нашел нечего подобного.
      • 21854
      • 58 Posts
      MODx ниче не создает, создают лиюо сниппеты криво настроенные либо у тебя шаблон корявый
        Working with MODX Revo|Evo, Laravel Framework. My website http://vanchelo.pp.ua
        • 7571
        • 135 Posts
        Скорее всего криво настроенные сниппеты. Только вот как найти эти ошибки и исправить.
          • 26883
          • 137 Posts
          Quote from: Djeak at Sep 28, 2010, 01:13 PM

          Скорее всего криво настроенные сниппеты. Только вот как найти эти ошибки и исправить.
          1. Анализировать по коду страницы, какой используется шаблон, какие чанки и сниппеты вызываются именно в этом месте.

          2. Проверять код самого шаблона или чанка.

          3. Для сниппета - смотреть, какие чанки используются при вызове сниппета в аргументах или по умолчанию.

          4. Искать код этих чанков в элементах MODx или в каталоге соответствующего сниппета, если чанки внешние.

          Исправлять то, на что указывает валидатор. Не всегда надо исправлять непременно все, иногда это и невозможно.
            • 7571
            • 135 Posts
            Подсказали, что редактор TinyMCE’s вызывает доп дивы.
            Одна из ошибок:
            # <noscript>
            # <style type="text/css">
            # .e2g_wrapper {display:none;}
            # </style>

            Вторая:
            # <div class="jsdisabled" id="jsdisabled">
            # <img src="assets/modules/easy2/templates/default/icons/error.png" alt="">
            # <span>Please enable javascript</span>
            # </div>
              • 9085
              • 630 Posts
              Похоже, обе ошибки искать в e2g aka Easy2Gallery
                Правильно заданный вопрос повышает вероятность получения нужного ответа.
                Что-то не работает? Загляните в лог ошибок!
                Есть проблема? "Локализуйте" её!
                Ответы на большинство вопросов по MODx | MODx RTFM | API Evo Revo | галопом по Европам Азиям smiley wikibooks(ru) Ditto(en) | Wayfinder e-book | Заметки и о MODx
                • 7571
                • 135 Posts
                Я тоже так думал, но в форуме про Easy2Gallery мне ответили, что:
                About the W3C validation, it’s not the E2G faults, its TinyMCE’s. It wraps the <noscript> and <div> tags with <p></p>. Try to disable RTE, and save your work.
                Я так понял, что RTE это редактор TinyMCE, отключил его в настройках, но ошибки не исчезли =(