We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts
    Strange issue with some TV's but not all. When MODX tags are inserted (chunks & snippets) either in rich text or html the TV output breaks.

    I replaced one offending TV with a new identical one (not a duplicate) which fixed that particular TV's issue. I attempted it again on another broken TV, nothing. I altered the name and all the calls in the template, and tried various replacement methods to no avail. Each replacement results in a working TV without MODX tags but as soon as anything with brackets is entered it breaks entirely. No output, no display.

    TV is set to Rich Text, output is default.

    Again, TV's work just fine as long as no MODX tags are used, and not all of the rich text TV's behave this way.

    Thank you for any assistance, as I can't make any sense of it all.





      Frogabog- MODX Websites in Portland Oregon
      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
      Having server issues? These guys have MODX Hosting perfected - SkyToaster
      • 3749
      • 24,544 Posts
      I suspect that TinyMCE is mangling the tags. Any TV that's going to contain MODX tags should probably not be set to richtext.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        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
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Ugh, it doesn't seem like that's what's mucking it up.

        I changed the TV type to text, entered the plain html with the chunk tag, got nothing. I tried changing the type to tags, created a chunk that included the html and chunk for the contact form... no workie. If I remove the chunk tag from the new chunk... it works fine.


        ???
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 3749
          • 24,544 Posts
          I just tried it and it's working for me. Can you post the TV tag from the page (with its surrounding HTML) and the content of the TV and the chunk? When you do a "View Source," are you getting any output at all where the TV tag is?


          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            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
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            The new chunk also works fine without the contact form chunk tag when the TV is set to rich text.

            So I can use this new chunk in the TV now, but not if the new chunk contains another chunk.

            Incidentally, I inserted the new chunk (containing contact form chunk) into the new replacement TV that I referenced above, the one that now is not broken. This TV pulls the chunk out just fine.

              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 3749
              • 24,544 Posts
              In Revolution, any tag can be uncached. You might have to play with the cache settings of the various chunk and TV tags. I generally try not to nest tags more then a couple of levels. When you have HTML code and snippet and chunk tags inside of chunk tags inside of TV tags, things get pretty messy. If I need to go deeper, I use a custom snippet with getChunk() and/or runSnippet().


              ------------------------------------------------------------------------------------------
              PLEASE, PLEASE specify the version of MODX you are using.
              MODX info for everyone: http://bobsguides.com/modx.html
                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
                • 10208 ☆ A M B ☆
                • 1,780 Posts
                Just lost the whole reply with everything pasted. Forum logged me out even.

                I'm using a previous version of Menno Pietersen's Flexibility package. It's nearly identical to the one available in package management since the applicable revisions were applied before it's release.

                Sorry it took so long, I keep missing your replies. I'll play with caching a bit. I'm not sure what the following information can tell you, it's fairly straightforward and basic (i.e. should work). It works just fine in the new TV that I made to replace the other one that broke when tags were added. This working TV results just below the following code from the template.

                from the template, the area where these TV's are called:

                <!-- START Content and optional sidebar -->
                	<div class="row">	<div class="content">
                		[[*sidebar:isnot=``:then=`
                		<div class="row">	
                			<div class="four columns">
                				<div class="sidebar">
                				<div class="search">
                					[[!SimpleSearchForm? &tpl=`SearchFormTpl` &landing=`12` ]]
                				</div>
                				<div class="clearfix"></div>
                				[[*sidebar]]
                				</div>
                			</div>
                			<div class="eight columns">
                		
                		`:else=`<div class="row">
                			<div class="twelve columns">
                		
                `]]
                		
                		
                				[[*content]]
                				<!-- START Optional content -->
                				[[If? &subject=`[[*liloLightbox]]` &operator=`notempty` &then=`<p>[[$page_lightbox_trigger]]</p>`]]
                				[[If? &subject=`[[*optional_gallery]]` &operator=`EQ` &operand=`yes` &then=`[[$page_gallery]]`]]
                				[[If? &subject=`[[*optional_contactform]]` &operator=`EQ` &operand=`yes` &then=`[[$landingContactform]]`]]
                				<!-- END  Optional content -->
                			</div>
                		
                		<!-- END Content and optional sidebar -->
                		</div>


                From the rich text TV - (This is the same as the content of the new chunk)
                <h3 style="text-align: center;">Contact Lilly Today</h3>
                <h3 style="text-align: center;"><img style="margin: 10px; border: 1px solid black; float: left;" title="Lilly Glass Akoto, LCSW" src="assets/templates/flexibility/images/lillyGlassAkoto5.jpg" alt="Lilly Glass Akoto - Grief & Loss, Suicide, Identity, Cultural Counselor" width="150" height="150" /></h3>
                <p style="text-align: center;"><strong><em>You may call me any time @
                ( 503) 442-0636</em></strong></p>
                <p> </p>
                <p>You may also email me through the <a title="Contact Lilly Glass Akoto" href="[[~5]]">contact form</a>. </p>
                <p> </p>
                <p>....I send you Hope for this hour......</p>
                <p> </p>
                
                 


                This is the offending tag - placed just below the above html resulting in a working and not working lightbox when added or removed. This html was only created after finding out that the tag wouldn't work. Ideally only a chunk tag would be in the TV.

                [[$liloLightboxContactform]]



                here's the contact form chunk. The one I originally wanted to use:

                [[!FormIt?
                &hooks=`spam,email,redirect`
                &emailTpl=`MyEmailChunk`
                &emailUseFieldForSubject=`1`
                &emailTo=`[[getResources? &resources =`11` &tpl=`email_adress_tpl` &includeTVs=`1` &processTVs=`1` &limit=`1` &tvPrefix=`` ]]`
                &redirectTo=`13`
                &validate=`name:required,email:email:required,subject:required,text:required:stripTags`
                ]]
                [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
                <form class="landingContactContainer" action="[[~[[*id]]]]" method="post" class="form">
                <h5>Talk to Lilly any time</h5>
                <p>This form will send an email directly to Lilly, 24 hours a day, 7 days a week. Please include your phone number so we can speak directly as soon as possible.</p>
                    <input type="hidden" name="nospam:blank" value="" />
                <p>
                    <label for="name">
                        Enter your name.
                        <span class="error">[[!+fi.error.name]]</span>
                    </label>
                    <input type="text" name="name" id="name" value="[[!+fi.name]]" />
                </p>
                <p>
                    <label for="email">
                        Fill in your email.
                        <span class="error">[[!+fi.error.email]]</span>
                    </label>
                    <input type="text" name="email" id="email" value="[[!+fi.email]]" />
                </p>
                <p>
                    <label for="subject">
                        Enter the subject of this mail.
                        <span class="error">[[!+fi.error.subject]]</span>
                    </label>
                    <input type="text" name="subject" id="subject" value="[[!+fi.subject]]" />
                </p>
                <p>
                    <label for="text">
                        Fill in your message or question.
                        <span class="error">[[!+fi.error.text]]</span>
                    </label>
                    <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
                </p>
                    <br class="clear" />
                 
                    <div class="form-buttons">
                        <input type="submit" value="Send" class="button pink nice round" />
                    </div>
                </form>
                [ed. note: frogabog last edited this post 14 years, 1 month ago.]
                  Frogabog- MODX Websites in Portland Oregon
                  "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                  Having server issues? These guys have MODX Hosting perfected - SkyToaster
                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  wow...

                  I called the chunk uncached and it popped right up.

                  Forever and always... Thank You Bob!
                    Frogabog- MODX Websites in Portland Oregon
                    "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                    Having server issues? These guys have MODX Hosting perfected - SkyToaster
                    • 3749
                    • 24,544 Posts
                    Glad it worked.

                    BTW, If I'm reading your code correctly, the optional_contactform TV would have to contain the word 'Yes' rather than the chunk name for it to work correctly. You could change it to a Yes/No TV and change the code to look for '1' instead of 'Yes'.


                    ------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using.
                    MODX info for everyone: http://bobsguides.com/modx.html
                      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
                      • 10208 ☆ A M B ☆
                      • 1,780 Posts
                      I've got "try uncached" my arsenal of things to try before posting now. If I was more organized I'd have a little notebook of these valuable reminders... hmmm...

                      The optional_contactform TV actually works as you see it, with a radio box TV to select yes/no for any page in the template. Take a look at the Flexibility site package if it doesn't make sense. I've been working with it's various forms for a while now and the latest release is using Foundation which I like very much. Make sure to install it on a fresh MODX installation.

                      If you do install it, maybe you can figure out why
                      <meta name="description" content="[[*introtext:empty=`[[*content:strip_tags]]`:limit=`200`]]" />


                      makes pages display two instances of snippets on each page (one displaying above the header) unless a character (anything) is entered into the introtext field.
                        Frogabog- MODX Websites in Portland Oregon
                        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                        Having server issues? These guys have MODX Hosting perfected - SkyToaster