We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22213
    • 52 Posts
    Just upgraded to the 6.4.2 release of newslisting. It now throws an error:

    Your NewsListing template is blank or you have a typo in the chunk name, please check it.
    


    I’m sure that the problem is incompatibilities with my newslisting call - everything was working fine on a lightly hacked version of 6.3.3. Here’s the newslisting call:

    [[NewsListing? &startID=`47` &summarize=`9` &levelLimit=`0` &seeThruUnpub=`1` &multilevel='1' &hidefolders='0' &total=`9` &tpl=`eventListingHome` &altRows=`alternate` &firstRow=`first` &lastRow=`last` &sortdir=`asc` &truncText=`More / Reserve` &sortby=`tvtestSort` &filter=`tvtestSort,[[unixtime]],3`]]
    


    the ’eventListingHome’ template chunk is there (as i say, nothing changed) here’s what it looks like:

    <!-- unixtime:[+tvtestSort+]-->
    <div class="textBlock [+altRow+] [+firstRow+] [+lastRow+]">
    
    	<a href="[~[+id+]~]" /><img src="[+tvtileimage+]" /></a>
    	<div style="width:310px; margin-left:100px;">
    	<p class="dateTime">[+tvshowDate+]</p>					
    	<a href="[~[+id+]~]" /><h3>[+title+]</h3></a>
    	<p>
    	[+summary+]
    	<br /> 
    	<span class="readMore">[+link+]</span>
    	</p>	
    	</div>
    </div>	
    


    Been up all night working, maybe my brain is fried...
      Web Designer
      PHP Programmer
      Cocoa Developer
      Boulevardier & Arriviste
      • 22213
      • 52 Posts
      should also mention two other things:

      - inserting the chunk into the template where the newslisting is called works, so it isn’t that modx can’t find it

      - I am calling three different instances of newslisting on the page, and all three have the same error

      any ideas?
        Web Designer
        PHP Programmer
        Cocoa Developer
        Boulevardier & Arriviste
        • 22213
        • 52 Posts
        Well, this thread is getting plenty of responses, all from me.... smiley

        I’ve learned that the version of newslisting that includes a couple of my ideas implements one of them differently. The idea is question is the idea of being able to differentiate first, last and alternate rows in a newslisting. My original implementation had done this using CSS and multiple selectors. You had the option to add selectors to whatever element, based on whether or not that element was the first, the last or an alternating row.

        In the implementation that is provided in 6.4.2, the approach is to allow the user to use different templates for the entire listinge element. I didn’t understand this, though I do remember that there were discussions between others of the use of multiple templates in newslistings. In my original implementation, the value of &firstRow, &lastRow and &alternateRows was a literal string that was the substitution text into the standard template. In the version currently available, these three items are references to chunks that are used as templates.

        I’ll sort this out for myself, but I want to point out that the there are strengths and weaknesses to the approach taken in 6.4.2, as there are in my approach. The real weakness in 6.4.2 is that a given listing element can only be one thing: either first, OR last, OR alternate OR the usual template. In reality, it may be several things: in a listing with only one result (article), that listing would be both first and last: not possible in 6.4.2. Similarly, the last listing could be both last and alternate: can’t be with the fixed templates approach.

        In my original version, the use of multiple selectors allowed any combination of these possibilities, so if the last item needed only to have a 1px solid blue line under it, then the selector could look like
        .last {border:1px solid blue;}
        

        and an alternate row might only have a different background
        .alternate {background: #ccc};
        


        This doesn’t limit a div from being

        <div class="newsItem first last">...
        

        or
        <div class="newsItem alternate last">...
        

        or even

        <div class="newsItem first last" id="newsitemlast">...
        


        for full-on DOM magick.

        All the other definitions would come from the normal template, which would allow you to change one element to globally affect the entire newslisting.

        My solution probably has cases where the limits of CSS would limit its flexibility, but I think that they would be marginal, given the use of contextual display: none|block|inline abilities in CSS, and as alluded to, the use of ids and DOM/JS.

        I guess my observation is that what we have is fine, but its a programmer’s rather than a designer’s solution, especially since it involves change of presentation being implemented not through the stylesheet(s) but within the CMS programming.

        Just my 2 cents.
          Web Designer
          PHP Programmer
          Cocoa Developer
          Boulevardier & Arriviste
        • I also vote for multiple CSS classes per item. I’m doing this in a rewrite of DropMenu in fact using templates.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me