We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32241
    • 1,495 Posts
    Found a tiny bug,

    in line 367 & 368, i comment the code out
    //if(count($resource) < 1 && $format == "rss") {return $xmlheader."".$xmlfooter;}	
    //$output .= (count($resource) < 1)? $emptytext."\n" : '';  
    


    It is being used twice on line 414-417.
      Wendy Novianto
      [font=Verdana]PT DJAMOER Technology Media
      [font=Verdana]Xituz Media
      • 18397
      • 3,250 Posts
      Wendy, that is not a bug. Those lines are there twice for two reasons. The first instance stops the snippet if there are no rows returned from the query and the second stops it if a filter is too aggressive and removes everything.
        • 32241
        • 1,495 Posts
        Hemm.. Can we just return null on the second one? Because it is showing 2 empty messages when I use it.
          Wendy Novianto
          [font=Verdana]PT DJAMOER Technology Media
          [font=Verdana]Xituz Media
          • 32241
          • 1,495 Posts
          Hemm...

          I’ve been trying to make this snippet work for what I want, but it seems that I lack the knowledge to use this snippet.

          Ok, here is the code
          [!NewsListing? &startID=`37` &emptytext=`No resources can be found!` &tpl=`ResourcesTpl` &truncText=`[details]` &sortby=`pagetitle` &sortdir=`asc` &summarize=`1` &showarch=`false` &alwaysshow=`1`!]
          
          <div class="separator"> </div>
          
          <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles
          <div id="nl_pages">[+previous+] [+pages+] [+next+]</div>
          


          I can’t seem to see the pagination link at the bottom of my page, after the newslisting. The archive is still appeared, even though I set it to false.

          Any thought of this?

          I just want to list 5/10 pages at a time, and allow pagination as a navigation to browse other pages that I have on that same folder.

          How the archive system work? What’s the different between the archive and the pagination? Why is it being added automatically, even though I already disable it?

          Thanks
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 32241
            • 1,495 Posts
            I got it working, I need to enabled pagination, and the archive and etc is disappear automatically. Cool stuff!

            Btw, I’m still wondering the different between archive and pagination though. Any though tof this will be great.

            Thanks
              Wendy Novianto
              [font=Verdana]PT DJAMOER Technology Media
              [font=Verdana]Xituz Media
              • 18397
              • 3,250 Posts
              Archive is the litle thing at the bottom that lists the entires that were retrieved but are not shown because the summary count does not include them. Pagination is where the content is on more than one page and links are used to sort through it (like on the MODx blog)

              RE: "Because it is showing 2 empty messages when I use it."

              I just realized that the empty text prob should be a return as well. I’ll look into this later today.
                • 32241
                • 1,495 Posts
                Nice.

                Thanks Mark.
                  Wendy Novianto
                  [font=Verdana]PT DJAMOER Technology Media
                  [font=Verdana]Xituz Media
                  • 6726
                  • 7,075 Posts
                  Again with experimenting with NewsListing.

                  So far I have used the &filter parameter without a problem, but on this new project I have it’s not working and I am really getting frustrated trying to understand what is wrong...

                  Here is my case : I am building a directory of employees, each of them have a page with defined TVs (name, job, skills, phone number, email...) grouped in a folder, which I want sorted alphabetically and by skills.

                  I tried to make the same call with &sortby=`tvnom` &sortdir=`desc` but the snippet doesn’t seem to support bortig by TV (does it ?).

                  But the main problem I have is the sorting by skills. It simply output nothing where it should do so (or at least, it did in my previous projects...) :

                  Snippet Call :

                  <h2 id="droit_famille_succession">Droit de la famille et successoral</h2>
                  <ul>[!NewsListing? &startID=`72` &tpl=`fiche_service` &summarize=`200` &emptytext=`Pas de collaborateur dans cette spécialité` &filter=`tvspecialite,Droit de la famille et successoral,1` &hiddentv=`specialite`!]</ul>
                  



                  TPL Chunk :

                  <div id="fiche"> 
                  <h3><a href="[~[+id+]~]" title="Consulter la fiche de [+tvprenom+] [+tvnom+]">[+tvnom+], [+tvprenom+]</a> - [+tvfonction+]</h3>
                  <p>[+tvemail+] | [+tvtel+]</p>
                  </div>



                  The TV used to filter is a checkbox.
                  I checked by changing the values, it’s not the spaces in my TV’s values. I also checked that the fact this TV could have multiple values did not interfere with the filter => checked only one value on some items and ran the snippet. I also went in the database with phpMyAdmin to see how multiple values were stored => It’s value2||value5.

                  If I pass &filter=`tvmytv,value2,1` into the snippet while the item’s TV has two checkbox checked : value2 and value5, will it return something, given that mytv’s value is value2||value5 ?

                  Maybe that’s what’s going wrong there ?

                  Please bear with me, might be obvious but I am getting nowhere with this...




                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l&#39;outil id
                    • 18397
                    • 3,250 Posts
                    David,

                    The snippet supports full sorting by tv so long as the values are "sortable" via php (it’ll sort alphabetically and numerically AFAIK).

                    As for the checkbox dillema I’m not quite sure whats happening. Are you saying that you have a tv with multiple checkbox’s and are trying to filter them when ONLY x number of the values are set to true?

                    If so, and outputting that TV returns this "value2||value5" then it would filter that exact string out.
                      • 6726
                      • 7,075 Posts
                      Quote from: Mark at Jan 30, 2006, 09:59 AM
                      The snippet supports full sorting by tv so long as the values are "sortable" via php (it’ll sort alphabetically and numerically AFAIK).

                      Good news !
                      Then it means I have been doing something wrong when I tried the &sortby=`tvnom` ... do I use tv prefix or not ? I think I tried both but then it’s not the plugin (using 6.3.2) but me doing something the wrong way.

                      Quote from: Mark
                      As for the checkbox dillema I’m not quite sure whats happening. Are you saying that you have a tv with multiple checkbox’s and are trying to filter them when ONLY x number of the values are set to true?

                      I indeed have a Tvs with multiple checkbox. I am not trying to filter when x number of the values are set to true, but list the items that have multiple checkbox set to true according to one of their checkbox (example below).

                      Quote from: Mark
                      If so, and outputting that TV returns this "value2||value5" then it would filter that exact string out.

                      But would it return anything if I try to filter all items with value2, even if one of them is set to value2||value5 or value2||value5||value8 ?

                      Thanks for the help !
                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l&#39;outil id