Announcement

Collapse
No announcement yet.

Tokenlist Issue After Update

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tokenlist Issue After Update

    So I am not positive which Miva update I noticed this after, but when trying to View All Toekns (Tokenlist) of a given page, I am met with a compile error similar to this:
    HTML Code:
    { "success": 0, "error_code": "MER-UTIL-TKNL-00021", "error_message": "JSON_Save_Template_Source_To_Temporary_File: Function miva_template_compile Failed with error At 135:105-135:109 - syntax error, unexpected IDENTIFIER, expecting \u0027\u003E\u0027 on file: ctgy.mvc" }
    Looking into the error location, it seems to be hitting a compilation error with code like this:
    HTML Code:
    <a href=/"&mvt:category:cf:ctgy_pdf1;/"<mvt:if expr="'.pdf' CIN l.settings:category:cf:ctgy_pdf1"> target=/"_blank/"</mvt:if>>&mvt:category:cf:ctgy_pdf1_text;</a>
    Where there is an "if" statement within an HTML tag to add additional attributes, classes, checked, etc.

    The initial View All Toekns error like this was on our OSEL page; I replaced the mid-HTML-tag IF with an IF/ELSE to write a full tag depending. This cleared the OSEL page of any 'errors' but this noted the same kind of compiling error on a different page.

    The page I am trying to View All Tokens is a waitlist email template - not associated with OSEL, BASK, CTGY, etc. but still throws an error citing these pages. The above error for the CTGY page is a great example as this page has not changed for the longest time; it has always had this mid-HTML-tag MVT markup in it.

    So did something change that Miva no longer likes this structure? Is there a different way to define HTML tag attributes using a MVT:IF without the longer IF/ELSE method? They pages work fine on their own client-side, but the View All Tokens process does not like it.

    #2
    AFAIK: View All Tokens requires:

    1) ALL templates to be recompiled, not just the ones you are looking at
    2) uses a different compiler which is much stricter and compiles them differently to display the end resulting page (hence the weird "\u0027\u003E\u0027" error string--that's JSON encoded characters)

    So, i've learned not to use coding forms like class="this <mvt:if>something</mvt:if>"

    Instead, you can do as what you did, OR, do something like

    <mvt:if expr="condition">
    <mvt:assign name="l.settings:pm:this_value" value="' target="_blank" '"/>
    </mvt:if>

    then just use &mvt:pm:this_value; in the HTML. If the condition is not true, it will just be blank.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Hey Bruce - PhosphorMedia, thanks for the info! I'll have to update quite a few pages then to make Tokenlist happy :(

      I was afraid that would be the case - so I guess there was some sort of update to the way View All Tokens complies? Like I mentioned, it had never done this before then abruptly changed to this more strict check.

      Comment


        #4
        I noticed that, in your code sample, there is a slash character right after the equal sign at the beginning of the <a> tag. I don't know if that's just a typing error in your forum post? If your actual template code contains the same error, you should probably fix that and try again.
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment


          #5
          Hey Kent Multer, good eye. That was a typo for the forum. I was playing around with escaping quotes in Miva to see if that may have done the trick and it looks like I pasted the wrong line of code in my initial question. The <a> line of code is:
          HTML Code:
          <a href="&mvt:category:cf:ctgy_pdf1;"<mvt:if expr="'.pdf' CIN l.settings:category:cf:ctgy_pdf1"> target="_blank"</mvt:if>>&mvt:category:cf:ctgy_pdf1_text;</a>

          Comment

          Working...
          X