We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I've been trying to troubleshoot what I can only assume is a bug somewhere.

    I have my own translation files within the core which I use for things outside of any plugin/snippet etc. Mostly for content titles which are meant to be translated and so on depending on the context the user is surfing.

    When I use the code to display the string in my template:

    [[%others_sample? &topic=`others`]]


    I clear the cache, then reload the page to preview. I see this padding at the top of the page. Further inspecting with firebug showed me that somehow, the contents of my <head> tag in the HTML get sent bellow the <body> tag. Causing this extra space.

    If I reload a second time (now that the page is in cache) then it works correctly.

    But everytime the cache is clear, on the first load, it appears wrong again.

    If I remove the lexicon tag, then all works perfectly.

    This seems to be some kind of issue with the lexicon tag but I have not been able to figure it out yet.

    To further test if there was anything else affecting this, I tried an empty HTML file with just the lexicon tag on it and exactly the same thing happened. There was nothing else in the html file other than the lexicon tag.
      • 3749
      • 24,544 Posts
      Is there anything unusual in the lexicon string? Does it contain any MODX tags?

      You could try the tag uncached, though I don't know why it should make a difference:

      [[!%others_sample? &topic=`others`]]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • No, it just contained regular text, nothing fancy.

        I was able to get rid of the error by duplicating the lexicon file and using a different name. Exactly the same file, just used a different name.

        I am wondering if there was a conflict or something with the name. The previous name was others.inc.php

        the new name is proc.inc.php

        I had tried the uncache version of it before and it game me same results.

        I know I've come across this problem more than once in the past. I had documented the file renaming thing before which is what I ended up doing, I'm just not sure what exactly is wrong there but there is something strange.
          • 3749
          • 24,544 Posts
          There may have been a problem with the line endings or the charset of the file that duplicating it fixed.

          I wouldn't think the original name would be a problem since MODX would only look in that one directory.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting