We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21056
    • 327 Posts
    In your rules do you have mm_widget_showimagetvs?

    If so, does the problem happen if you comment it out?
      Author: ManagerManager plugin - customise your ModX manager interface

      Rckt - web development, Sheffield, UK
      • 25803 ☆ A M B ☆
      • 721 Posts
      Quote from: ncrossland at Aug 27, 2008, 08:26 AM

      In your rules do you have mm_widget_showimagetvs?

      If so, does the problem happen if you comment it out?

      Yes I did and when commented out, I can now create new documents.
        • 21056
        • 327 Posts
        I can’t remember exactly where the fix for this was... Try replacing the contents of /assets/plugins/managermanager/widgets/showimagetvs/showimagetvs.php with:

        <?php
        
        //---------------------------------------------------------------------------------
        // mm_widget_showimagetvs
        // Shows a preview of image TVs
        // Emulates showimagestv plugin, which is not compatible with ManagerManager
        //--------------------------------------------------------------------------------- 
        
        
        function mm_widget_showimagetvs($tvs='', $w=300, $h=100, $thumbnailerUrl='', $roles='', $templates='') {
        	
        	global $modx, $content;
        	$e = &$modx->Event;
        	
        	if (useThisRule($roles, $templates)) {
        		
        		$output = '';	
        				
        		$site = $modx->config['site_url'];
        		
        		if (isset($w) || isset($h)) {
        			$w = isset($w) ? $w : 300;
        			$h = isset($h) ? $h : 100;
        			$style = "'max-width:{$w}px; max-height:{$h}px; margin: 4px 0; cursor: pointer;'";
        		} else {
         			$style = '';
        		}
        				
        		// Does this page's template use any image TVs? If not, quit now!
        		$tvs = tplUseTvs($content['template'], $tvs, 'image');
        		if ($tvs == false) {
        			return;
        		}		
        
        		
        		$output .= "// ---------------- mm_widget_showimagetvs: Add image preview ------------- \n";
        
        				
        		// Go through each TV 
        		foreach ($tvs as $tv) {
        			
        			$new_html = '';
        			
        			$output .= '
        			// Adding preview for '.$tv['name'].'
        			$("#tv'.$tv['name'].'").bind( "change load", function() {
        				
        				// Get the new URL
        				$(this).addClass("imageField");
        				var url = $(this).val();
        				url = (url != "" && url.search(/http:\/\//i) == -1) ? ("'.$site.'" + url) : url;
        				
        				';
        				
        				// If we have a PHPThumb URL
        				if (!empty($thumbnailerUrl)) {
        					$output .= 'url = "'.$thumbnailerUrl.'?src="+escape(url)+"&w='.$w.'&h='.$h.'"; ' . "\n";
        				}
        				
        			$output .= '	
        				// Remove the old preview
        				$("#'.$tv['name'].'PreviewContainer").remove();
        				
        				if (url != "") {
        					// Create a new preview
        					$("#tv'.$tv['name'].'").parents("td").append("<div class=\"tvimage\" id=\"'.$tv['name'].'PreviewContainer\"><img src=\""+url+"\" style=\""+'.$style.'+"\" id=\"'.$tv['name'].'Preview\"/></div>");	
        					
        					// Attach a browse event to the picture, so it can trigger too
        					$("#'.$tv['name'].'Preview").click( function() {
        														BrowseServer("tv'.$tv['name'].'");		 
        																 });
        				}
        				
        			}).trigger("load"); // Trigger a change event on load
        	
        			
        			';	
        			
        		}
        		
        		$output .= '
        		
        			// If we have imageTVs on this page, modify the SetUrl function so it triggers a "change" event on the URL field
        			if (typeof(SetUrl) != "undefined") {
        				OriginalSetUrl = SetUrl; // Copy the existing Image browser SetUrl function						
        				SetUrl = function(url, width, height, alt) {	// Redefine it to also tell the preview to update
        					OriginalSetUrl(url, width, height, alt);
        					$(".imageField").trigger("change");
        				}
        			}
        		';
        		
        		
        		
        		
        		$e->output($output . "\n");		
        	}
        	
        } // end of widget
        
        ?>
          Author: ManagerManager plugin - customise your ModX manager interface

          Rckt - web development, Sheffield, UK
          • 25803 ☆ A M B ☆
          • 721 Posts
          Quote from: ncrossland at Aug 27, 2008, 08:34 AM

          I can’t remember exactly where the fix for this was... Try replacing the contents of /assets/plugins/managermanager/widgets/showimagetvs/showimagetvs.php with:

          Ok. Will do and report back after an appointment I have to get to. My SEO tab is missing on creating a new document whereas the others are there but I’ll have a look at my plugin call more closely.

          As others have mentioned, this plugin is extremely beneficial for clients who use MODx after the developers/designers have handed it off. I’m creating a standard base install with all the plugins, snippets, tvs, and chunks that we commonly use and combining tabs for each one. Thanks again.
            • 19164
            • 1,215 Posts
            Hi!

            What about problem
            SQL: SELECT name FROM `DBxxxxx`.`modx_site_tmplvars` tvs LEFT JOIN `DBxxxxx`.`modx_site_tmplvar_templates` rel ON rel.tmplvarid = tvs.id WHERE 1=1 AND type IN (’image’) AND rel.templateid =

            Is it solved? It seems that problem is in mm_widget_showimagetvs() rule when it’s applied to template without any image TV. Try last code from previouse post, it have no effect.
              DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

              Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

              [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
              • 21056
              • 327 Posts
              Quote from: Metaller at Aug 27, 2008, 09:00 AM

              Hi!

              What about problem
              SQL: SELECT name FROM `DBxxxxx`.`modx_site_tmplvars` tvs LEFT JOIN `DBxxxxx`.`modx_site_tmplvar_templates` rel ON rel.tmplvarid = tvs.id WHERE 1=1 AND type IN (’image’) AND rel.templateid =

              Is it solved? It seems that problem is in mm_widget_showimagetvs() rule when it’s applied to template without any image TV. Try last code from previouse post, it have no effect.
              Yes, that’s solved too... I don’t have version control so I don’t know which files fixed it. I’ll see about putting out a new release which doesn’t have these issues...
                Author: ManagerManager plugin - customise your ModX manager interface

                Rckt - web development, Sheffield, UK
                • 27749
                • 53 Posts
                I had a similar problem (blank page..) but that was only if _blank template was applied / selected as default template for created documents.

                Looking forward the new version wink
                  • 27541
                  • 29 Posts
                  Quote from: skt at Aug 20, 2008, 02:30 PM

                  Quote from: ncrossland at Aug 20, 2008, 10:38 AM

                  Try removing the "break;" and seeing if it works now...

                  i’ve done so -- no change that i can see.

                  hi again, any additional thoughts on my problems? i’d love to be able to use this to organize all the template variables into tabs.
                  many thanks,
                  ST
                    • 21056
                    • 327 Posts
                    Quote from: skt at Aug 27, 2008, 10:22 AM

                    Quote from: skt at Aug 20, 2008, 02:30 PM

                    Quote from: ncrossland at Aug 20, 2008, 10:38 AM

                    Try removing the "break;" and seeing if it works now...

                    i’ve done so -- no change that i can see.

                    hi again, any additional thoughts on my problems? i’d love to be able to use this to organize all the template variables into tabs.
                    many thanks,
                    ST

                    I’m having trouble reproducing your problem -- I’ve tested, and can move multiple TVs to tabs. What language are you using?
                      Author: ManagerManager plugin - customise your ModX manager interface

                      Rckt - web development, Sheffield, UK
                      • 27541
                      • 29 Posts
                      Quote from: ncrossland at Aug 27, 2008, 10:32 AM

                      I’m having trouble reproducing your problem -- I’ve tested, and can move multiple TVs to tabs. What language are you using?

                      hmm, not sure i understand. i’m guessing you mean what language did i use in mm_rules? php, i thought, but perhaps i’ve got some incorrect syntax... here’s the mm_rules:
                      // Hide Content section for templates that do not use it
                      mm_hideSections('content', '', '1,2');
                      
                      // Create new tabs to organize template variable editing
                      $pageTabIntro = '<p>This page uses a template that defines edit-able areas.  Edit these here.</p>';
                      mm_createTab('Page Content', 'pageTVs', '', '', $pageTabIntro);
                      
                      $sbTabIntro = '<p>If you want custom sidebar text for this page only, edit sidebar content here.  Note that the change will not be made on all pages -- for that, you must make edits in the Chunks section.</p>';
                      mm_createTab('Sidebar Content', 'sbTVs', '', '', $sbTabIntro);
                      
                      // Move TVs to appropriate tabs
                      $pageTVs = 'tvhomeText, tvtagline, tvsidebarFirst, tvsidebarSecond, tvnewsitem1, tvnewsitem2, tvnewsitem3';
                      mm_moveFieldsToTab($pageTVs, 'pageTVs');
                      
                      $sidebarTVs = 'tvsbaCustomHead, tvsbaCustomText, tvsbaSocialHead, tvsbaSocialText, tvsbbCustomHead, tvsbbCustomText, tvsbbMerchHead, tvsbbMerchText, tvsbbXmasCDHead, tvsbbXmasCDText';
                      mm_moveFieldsToTab($sidebarTVs, 'sbTVs');
                      

                      many thanks, i appreciate your time & help on this issue.
                      skt

                      This discussion is closed to further replies. Keep calm and carry on.