We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hello, we have a template variable (type: textarea) for users to cut and paste conversion scripts into for particular pages.

    In the back end, it works fine. We can paste a conversion script like so:

    <script type="text/javascript"> 
    /* <![CDATA[ */
    var google_conversion_id = 1234567890;
    var google_conversion_language = "en_US";
    var google_conversion_format = "1";
    var google_conversion_color = "666666";
    var google_conversion_label = "Purchase";
    if (10.0) {
    var google_conversion_value = 10.0
    }
    /* ]]> */ 
    </script>
    <script type="text/javascript" 
    src="http://www.googleadservices.com/pagead/
    conversion.js">
    </script>
    <noscript>
    <img height=1 width=1 border=0 
    src="http://www.googleadservices.com/pagead/
    conversion/1234567890/
    ?value=10.0&label=Purchase&script=0">
    </noscript>


    In the front end, using Newspublisher, when submitted we are left only with this:


    /*  */ 
    
    
    
    
    <img height=1 width=1 border=0 
    src="http://www.googleadservices.com/pagead/
    conversion/1234567890/
    ?value=10.0&label=Purchase&script=0">


    Our Newspublisher call is:
    [[!NewsPublisher?
    &initrte=`1`
    &rtcontent=`1`
    &initdatepicker=`1`
    &textmaxlength=`1000`
    &show=`[[$commonfields]],[[$blogfields]]`
    &parentid=`[[doclookup? &alias=`blog/`]]`
    &template=`Blog Article`
    &published=`1`
    ]]


    Where commonfields are:

    pagetitle,longtitle,alias,introtext,menutitle,hidemenu,published,menuindex,content,pub_date,seodescription,seokeywords,seorobots,seoconversiontracking


    seoconversiontracking is the TV.

    blogfields are:

    blogauthor,blogauthorimage,youtubevideo,videocaption,pdfdownload
      • 36704
      • 131 Posts
      Hi,

      Did you try to replace: &show=`[[$commonfields]],[[$blogfields]]`
      &show=`commonfields,blogfields`
      • That is not an issue. They are just both chunks with a bunch of comma delimited fields. It works the same way if we put the fields in chunks or not. If we put the name of the chunks in without the chunk syntax we wouldn't see any fields.
          • 44985
          • 27 Posts
          Quote from: rx2 at Nov 08, 2012, 01:28 PM
          Hello, we have a template variable (type: textarea) for users to cut and paste conversion scripts into for particular pages.

          Any chance you came up with a solution for this? I'm having a similar issue with NewsPublisher.

          Admin users can input a Youtube video's embed code into a textarea without any problem, but a NewsPublisher editor can't. When a NewsPublisher editor saves the document, the embed code is never kept in the database.

          I narrowed it down to the <iframe> opening and closing tags. Once I delete them, the NewsPublisher editor can save the data without any problem.

          I'm hoping you came up with a solution?

          Sar


          • MODX Version: MODX Revolution 2.2.7-pl (traditional)
          • PHP Version: 5.3.24
          • Database MySQL Version: 5.5.30-cll
          • Formit Version: 2.2
            ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley
            • 3749
            • 24,544 Posts
            This is a known "feature" of TinyMCE. Allowing iFrames is a security issue, so you don't want to do this unless your NewsPublisher editors are completely trustworthy.

            Try this:

            Edit the TinyMCE plugin. On the "Properties" tab. Use the Create New Property Set button to create a Property Set for TinyMCE (unless you have one already -- in which case add the new property to it).

            In your new property set, create a new property called extended_valid_elements with this value:

            iframe[src|title|width|height|frameborder|scrolling]

            Click on the "Save Property Set Button."

            On the System Events Tab, scroll down to the three checked Events. For each one, double-click on the "Property Set" column and select your new property set, then click somewhere else on the page to make the setting stick.

            Important: Click on the "Save" button at the upper right to save the plugin.

            Clear the site cache.

            I'm not sure this will work in the front end, but it's worth a try.

            There's another way that involves changing the NewsPublisher class code, but try the above first.
              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
              • 44985
              • 27 Posts
              Quote from: BobRay at Sep 07, 2013, 07:18 PM
              This is a known "feature" of TinyMCE. Allowing iFrames is a security issue, so you don't want to do this unless your NewsPublisher editors are completely trustworthy.

              Try this:

              Edit the TinyMCE plugin. On the "Properties" tab. Use the Create New Property Set button to create a Property Set for TinyMCE (unless you have one already -- in which case add the new property to it).

              Hi Bobray,

              I've followed your steps and cleared cache but it didn't change anything unfortunately. Is it easy to change the NewsPublisher class code?

              Sar
                ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley
                • 44985
                • 27 Posts
                Quote from: BobRay at Sep 07, 2013, 07:18 PM
                There's another way that involves changing the NewsPublisher class code, but try the above first.

                Hi Bobray,

                I've managed to fix it smiley Thanks for your advice. I added <iframe> to line 1345 in core/components/newspublisher/model/newspublisher/newspublisher.class.php.

                Thx again,
                Sar
                  ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley
                  • 3749
                  • 24,544 Posts
                  Nice fix. I can see that my other suggestion couldn't have worked. wink

                  Thanks for reporting that.
                    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
                    • 44985
                    • 27 Posts
                    Quote from: BobRay at Sep 08, 2013, 07:58 AM
                    Nice fix. I can see that my other suggestion couldn't have worked. wink

                    Thanks for reporting that.

                    Haha. Well I wouldn't have looked in the class file if you didn't mention it!

                    I should have made a new question so I could star your reply :S
                      ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley
                      • 3749
                      • 24,544 Posts
                      Star your own reply with the solution. I'm pretty sure that's possible. smiley
                        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