We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20508
    • 157 Posts
    Hi All,

    I’m almost successful in implementing dynamic chunks using template variables, (with this great tutorial: http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks#Create_Some_Chunks).

    However, I’m getting a parse error listed below. My document validates, so I don’t think the extra "<" is coming from my code. I think it’s being caused when this line of code (in my template) is used to call in the information (include): [!chunkListParser?chunks=`[*leftChunks*]` &wrapperdiv=`left`!]

    Parse error: syntax error, unexpected ’<’ in /usr/home/xxx/public_html/mywebsite.com/manager/includes/document.parser.class.inc.php(766) : eval()’d code on line 2



    Additionally...

    I found this little tidbit of information regarding the Parse Error that I’m having. I’m using version 0.9.6 of MODx. I tried removing the "<?php" in the first line of code and the "<?" in the last line in the PHP document "document.parser.class.inc.php" but that did not work - made the page go away completely. However I still think the issue is coming from this document.

    Documentation:

    "Parse error, unexpected ’<’ in /manager/includes/document.parser.class.inc.php(705) : eval()’d code on line 1"

    "This is one of the most common parse errors in pre 0.9.5 releases. There is a <? or <?php in the first line of the snippet code which must be removed. Also, look at the end of the snippet code and ensure it does not contain ?>. In 0.9.5+ <?php tag is detected in the snippet code and dealt with. Developers often put <?php to the start of the snippet code to get syntax coloring working in their text editors and that’s the most common reason why you may see some snippets having them."

    Source: http://wiki.modxcms.com/index.php/Common_snippet_error_messages_and_their_meaning

    Anyone run into this issue or have any thoughts on how to resolve it?
      • 22303 MODX Staff
      • 10,725 Posts
      This is a PHP syntax error in line 1 of your snippet code which is being eval()’d in document.parser.class.inc.php at line 766. You need to remove the extra PHP tags in your snippet code. You should never remove PHP tags from core MODx files.
        • 20508
        • 157 Posts
        Ah - I didn’t even think of the snippet code. I didn’t realize the PHP tags were inserted automatically. Thank you, it worked beautifully - except the chunk is not showing up at all in the sidebar. I followed the instructions and checked it over several times. Is there anyway to pinpoint why this might be happening or any troubleshooting guides for TV based chunks?

        Thanks again,
        msflux.
          • 20508
          • 157 Posts
          I started over again and it’s now working. Something must have been out of order when I tried it the first time. Thanks!