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

    I am using quickedit and I have in the template the following

    <div id="right_content"><quickedit:link_img_1 /><quickedit:img_1 /><a href="[*link_img_1*]">[*img_1*]</a>


    Because of that the page cannot be validated

    #  Line 79, column 54: element "quickedit:link_img_1" undefined
    
    …ight_content"><quickedit:link_img_1 /><quickedit:img_1 /><a href="http://www.


    I need to somehow to remove the quickedit tags in the frontend when nobody is logged in as a content editor
    Maybe there I can create some kind of snippet. Something like this:

    if modx->ContentEditorSessionExists() {
    display <quickedit:link_img_1 /><quickedit:img_1 />
    } else {
    display nothing
    }

    Thank you


      • 14050
      • 788 Posts
      Clear your cache and then visit your site while not logged into the manager. That should keep the quick edit tags from displaying when you try to validate it.

        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
        • 5340
        • 1,624 Posts
        I tried. It’s the same

        I think it’s because I am using <quickedit:link_img_1 /><quickedit:img_1 /> not [*#name*]
        And that is not an option for me because of <a href="[*link_img_1*]">[*img_1*]</a>

          • 5340
          • 1,624 Posts
          Solved

          create a snippet and place it in the template


          <?php
          if(isset($_SESSION[’mgrValidated’])) {
          echo ’<quickedit:name />’;
          }
          else
          {

          }
          ?>
            • 27376
            • 576 Posts
            Quote from: xpix at Nov 12, 2007, 08:34 AM

            I think it’s because I am using <quickedit:link_img_1 /><quickedit:img_1 /> not [*#name*]
            And that is not an option for me because of <a href="[*link_img_1*]">[*img_1*]</a>
            Yes, you should not be hard-coding the <quickedit:> tags. Always use the hash (#) symbol and TVs for quickedit-managed code. Otherwise, it won’t be removed when you’re not logged in to the manager.

            Also, it is a known issue that these tags are being cached as described in FS#635.
              • 5340
              • 1,624 Posts
              (#) does not work for me
              because I have not found a way to do this <a href="[*#link_img_1*]">[*#img_1*]</a>

              Maybe you know another way to let users modify the link of an image.
                • 25663 MODX Staff
                • 12,272 Posts
                Use two TVs ... one for the link location (that’s the ID of the page) and one for the actual image itself (image type) ... no?
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 5340
                  • 1,624 Posts
                  <a href="[*#link_img_1*]">[*#img_1*]</a>

                  That is what I have done. But for the link TV the display of the quickedit tag has to be outside <a href Tag.