We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20231
    • 12 Posts
    Hi, I’ve been working on a jobs listing site for a client, and all of a sudden, I’m getting some bad errors, and my pages won’t display.

    I had set up a tagged blog using the instructions here: http://wiki.modxcms.com/index.php/Tagged_blogging_with_Ditto . My client posts jobs in different industries, and each job post will be tagged with one category(industry).

    I had a template set up for the home page, and one for the "Jobs" page. Each of these templates included a Ditto call as per the "Tagged blogging with Ditto" tutorial. Everything was working great.

    I then upgraded to the latest version of Modx, which I’m wondering if this is what may have caused my issue, and then today I did some further development on the job listings by working on the display of each individual listing. I created a new template ("Listing") and went through the 8 test job posts I have and edited them to use that template.

    And then all hell broke loose! When I try and load either the "Home" page or the "Jobs" page, I get the following error:
    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	implode() [function.implode]: Invalid arguments passed	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	C:\wamp\www\erc\manager\includes\document.parser.class.inc.php(770) : eval()'d code	 
      Line: 	103	 
     
    Parser timing
      MySQL: 	0.0051 s	(6 Requests)
      PHP: 	0.0678 s	 
      Total: 	0.0729 s
    


    I can not figure out what would be causing this, besides a problem with the Ditto calls. I’m posting the templates from my home and job pages, and the chunk code templates that Ditto uses to format output. Any help would be so greatly appreciated!

    Home page:
    {{head}}
    
    <body id="home">
    	<div id="container">
    		
    		<div id="header_wrap">
    			<div id="header_phone">Call us today: <span></span></div>
    			<div id="header">
    				<h1><span>acme Jobs</span></h1>
    				{{navigation}}
    			</div>
    		</div>
    		<div id="content_wrap">
    			<div id="content">
    				
    				<div id="intro">
    					<div id="pitch">
    						<p>We specialize in the recruiting and placement of individuals in the Medical, Accounting, Finance, Banking, and Agriculture industries.</p>
    						<a class="cta button" href="[(site_url)]contact.html" title="Contact us today!"><span>Contact us today!</span></a>
    					</div>
    					
    					<img src="/acme/images/banner.jpg" alt="" />
    				</div>
    				
    				<div id="welcome">
    					[*content*]
    					<div id="features">
    						{{our_services}}
    						
    						{{benefits}}
    						<div class="cleared"></div>
    					</div>
    				</div>
    				
    				<div id="hot_jobs">
    					<h2>Hot Jobs</h2>
    					[!Ditto? &startID=`5` &tpl=`hotjob` &display=`4` &tagData=`tvtags` &tagDelimiter=`,` !]
    					
    				</div>
    				
    				<div id="testimonials">
    					<h3>What our clients are saying:</h3>
    					<div class="cust_quote">
    						<blockquote>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </blockquote>
    						<cite>Joe Black</cite>
    					</div>
    					<div class="cust_quote">
    						<blockquote>Ut enim ad minim veniam, quis nostrud exacmeitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </blockquote>
    						<cite>Mary Pomegranate</cite>
    					</div>
    					<div class="cust_quote">
    						<blockquote>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </blockquote>
    						<cite>Charles Plaidstock</cite>
    					</div>
    					<div class="cleared"></div>
    				</div>
    				
    			</div>
    		</div>
    		
    		<div id="footer_wrap">
    			{{footer}}
    		</div>
    		
    	</div>
    	
    </body>
    </html>



    The Jobs page:
    {{head}}
    
    <body id="jobs">
    	<div id="container">
    			
    		<div id="header_wrap">
    			<div id="header_phone">Call us today: <span></span></div>
    			<div id="header">
    				<h1><span>acme Jobs</span></h1>
    				{{navigation}}
    			</div>
    		</div>
    		<div id="content_wrap">
    			<div id="content">
    				[*content*]
    				
    				[!Ditto? &startID=`5` &tpl=`job-post` &tagData=`tvtags` &tagDelimiter=`,` &summarize=`5` &paginate=`1` &paginateAlwaysShowLinks=`1`!]
    				
    				<p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles | Page <strong>[+currentPage+]</strong> of <strong>[+totalPages+]</strong> </p> <div id="ditto_pages"> [+previous+] [+pages+] [+next+] </div>
    			</div>
    			
    			{{sidebar}}
    			
    		<div id="footer_wrap">
    			{{footer}}
    		</div>
    		
    	</div>
    </body>
    </html>



    The "hotjob" template chunk the home page Ditto call uses:
    <div class="hotjob [+tags+]">
    	<div class="job_date">[+pub_date:date=`%b<strong>%d</strong>`+]
    	</div>
    	<h3 class="job_title"><a href="[~[+id+]~]">[+title+]</a></h3>
    	
    	[[tagLinks? &id=`[+id+]` &tv=`tags` &separator=`, ` &fap=`1` &path=`categories` &label=`Tags: ` &style=`job_tags`]]
    	
    	<div class="job_info">
    		<p>[+introtext+] [+link+]
    		 <a class="more_link" href="[~[+id+]~]">View this job</a>	
    		</p>
    		
    	</div>
    	<div class="cleared"></div>
    </div>



    And, finally, the "job-post" template chunk that the Jobs page Ditto call uses:
    <div class="job_post [+tags+]">
    	<div class="job_date">[+pub_date:date=`%b<strong>%d</strong>`+]
    	</div>
    	<h3 class="job_title"><a href="[~[+id+]~]">[+title+]</a></h3>
    	
    	[[tagLinks? &id=`[+id+]` &tv=`tags` &separator=`, ` &fap=`1` &path=`categories` &label=`Tags: ` &style=`job_tags`]]
    	
    	<div class="job_info">
    		<p>[+introtext+] [+link+]
    		 <a class="more_link" href="[~[+id+]~]">View this job</a>
    		</p>
    	</div>
    	<div class="cleared"></div>
    </div>


    Again, any help would be greatly appreciated!

    Thanks!
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Did you clear your site cache after upgrading?
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 3749
        • 24,544 Posts
        Clear your browser cache and cookies also.
          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
          • 20231
          • 12 Posts
          Clearing the cache, browser cache and cookies doesn’t seem to help.

          I reverted to a backup of the site which I had made right before upgrading, and it worked fine, until I added this new template for the individual listings, and then the site freaked out like I described above.

          My document tree has a page "My Jobs", and all the job listings are individual documents posted under this. I had gone through and changed the template that these job listings used to this template:

          The "Listing" template:
          {{head}}
          
          <body id="job">
          	<div id="container">
          			
          		<div id="header_wrap">
          			<div id="header_phone">Call us today: <span></span></div>
          			<div id="header">
          				<h1><span>acme Jobs</span></h1>
          				{{navigation}}
          			</div>
          		</div>
          		<div id="content_wrap">
          			<div id="content">
          				<div class="job_post [+tags+]">
          					<div class="job_date">[+pub_date:date=`%b<strong>%d</strong>`+]
          					</div>
          					<h3 class="job_title"><a href="[~[+id+]~]">[+title+]</a></h3>
          					
          					[[tagLinks? &id=`[+id+]` &tv=`tags` &separator=`, ` &fap=`1` &path=`categories` &label=`Tags: ` &style=`job_tags`]]
          					
          					<div class="job_info">
          						[*content*]
          					</div>
          					
          					<ul class="job_data"><!-- These are TV's that the "Jobs" template uses -->
          						<li>Salary: [*salary*]</li>
          						<li>Benefits: [*benefits*]</li>
          						<li>Location: [*location*]</li>
          						<li>Qualifications: [*qualifications*]</li>
          					</ul>
          					
          					<div class="cleared"></div>
          				</div>
          				
          			</div>
          		
          			{{sidebar}}
          		</div>
          		<div id="footer_wrap">
          			{{footer}}
          		</div>
          		
          	</div>
          </body>
          </html>


          And that’s what’s causing the fuss, apparently.

          If any of the subdocuments of the "My Jobs" page use this Listing template, the site freaks out. If I change them all to use the Jobs template, everything works again.

          I figured that this was because of the Tags calls or because of using placeholders, but I’m still pretty new to Modx, so I don’t have a great grasp of how to modify this to work properly. I basically want access to the Tag links and all the same variables I’m pulling in on the "job-post" template I had posted in the original post.

          Thanks.

            • 3749
            • 24,544 Posts
            The only think I can see is this:
            <div class="job_date">[+pub_date:date=`%b<strong>%d</strong>`+]


            Putting the <strong> tag around the date could be confusing the output filter and I think you might also need the strtotime modifier (I know you would in Revolution). Try this:

            <div class="job_date">[+pub_date:strtotime:date=`%b %d`+]


            or this:

            <div class="job_date">[+pub_date:date=`%b %d`+]


            Otherwise, has anything changed in the {{head}} chunk? or the other chunks?

              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
              • 20231
              • 12 Posts
              Posting that last bit made a lightbulb turn on in my head...

              I found that I had neglected to enable access to the custom TV’s I had made for the job listings in the "Listing" template. Once I did that, it stopped freaking out.

              Thanks for the help anyway!
                • 3749
                • 24,544 Posts
                Glad you got it fixed.

                If PHX puts out something other than an empty string when parsing an empty TV with the date modifier, I’d consider it a bug.
                  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