We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33688
    • 54 Posts
    Hey guys,

    I’m setting up a simple weblog and want to use three NewsListing calls on the same page for three different purposes:

    1) To display the five latest blog posts in full, along with longtitle, author’s full name and date published. This is to be listed in the main column of the page;

    2) To display a list with the latest blog posts #6-16 with the longtitle only, truncated at 25 letters. This is to be listed in the sidebar column;

    3) A monthly archive, listing the month and year in a list like this. Also listed in the sidebar column :

    - April 2006
    - March 2006
    - February 2006

    And when all the selected month’s blog posts are listed, I want to paginate them and show... say 10 posts on each page.

    - - - - -

    Now, I’m still struggling with understanding the NewsListing documentation on how to accomplish something like this. Can anyone please give me a hint how to shape these snippet calls? (I am using NewsListing 6.4.1)

    Any help appreciated, smiley

    Mats W.
      • 33688
      • 54 Posts
      Alright, I start myself and hopefully someone will fill in the blanks and correct me where I wander off... smiley

      1) [[NewsListing? &tpl=`BlogPageTemplate1` &startID=`9` &summarize=`5` &showarch=`0` ]]

      BlogPageTemplate1:
      <div class="whatever">
      <h3>[+longtitle+]</h3>
      <p>Posted by [+author+] on [+pub_date+]</p>
      <p>[+content+]</p>
      </div>

      My comments:
      I can’t find any reference in the documentation how to show the author’s fullname in a placeholder like [+author+]. But I notice in the snippet code there *is* such a placeholder. Can I assume this is for the author’s fullname and not anything else? This post seems to suggest it is, at least that’s how I read it. Can anyone shed light on this?

      2) [[NewsListing? &tpl=`BlogPageTemplate2` &startID=`9` &summarize=`16` &filter=`!=the five absolutely latest post` &showarch=`0` ]]

      BlogPageTemplate2:
      <div class="listblock"> <!-- styles the unordered list -->
      <ul>
      <li><a href="[~[+id+]~]"</a>[+longtitle+]</li>
      </ul>
      </div>

      My comments:
      I want to show only the latest posts #6-16, so I &summarize = 16 and try to filter out #1-5. But I’m not sure how to form the argument to do it. Any suggestions or other solutions? And, how do I truncate the longtitle at 25 characters maximum to fit in my sidebar column?

      3) [[NewsListing? &tpl=`BlogPageTemplate3` &startID=`9` &showarch=`1`]]

      BlogPageTemplate3:
      <div class="listblock">
      </div>

      My comments:
      I want to show a list of monthly archives only. Is this the way to do it, using parameter &showarch = 1 and not using any placeholders at all? And how do I control the output and style(s) of the pages created when I click on the month links? Do I have to hack the snippet code (starting with $archivehtml) to do it, or how do you go about that part? Are the results displayed on the same page or on a new page?

      *****

      As you can see, this is what I can gather from reading the (sometimes scant) documentation and by scanning the snippet code (as a non-coder). Please forgive me if there are things I completely misunderstand, and I probably show my complete ignorance in some other areas. But at least I’m trying, so please bear with me. tongue

      Mats W.


      P.S. Regarding the comment on the (sometimes scant) documentation, I completely understand it’s bound to be trailing behind in a heavy development stage as this, and I assume it will be put right in due time to eventually form a top notch documentation system. wink D.S.
        • 8471
        • 333 Posts
        Quote from: Mats at Apr 27, 2006, 02:34 PM

        3) A monthly archive, listing the month and year in a list like this. Also listed in the sidebar column :

        - April 2006
        - March 2006
        - February 2006

        And when all the selected month’s blog posts are listed, I want to paginate them and show... say 10 posts on each page.
        I can’t understand how I can do it, is it possible?
          Sorry for my bad English grin
          • 18397
          • 3,250 Posts
          Quote from: edipo at Apr 30, 2006, 12:14 PM

          Quote from: Mats at Apr 27, 2006, 02:34 PM

          3) A monthly archive, listing the month and year in a list like this. Also listed in the sidebar column :

          - April 2006
          - March 2006
          - February 2006

          And when all the selected month’s blog posts are listed, I want to paginate them and show... say 10 posts on each page.
          I can’t understand how I can do it, is it possible?

          Set summarize to 0 and showarch to 1.
            • 18397
            • 3,250 Posts
            [+author+] should display the fullname of a user if it is set.

            The easiest way to handle the next five posts is to try NL 6.4.2 and use the new parameter &start. You can get it here.
              • 8471
              • 333 Posts
              Quote from: Mark at Apr 30, 2006, 10:24 PM

              Quote from: edipo at Apr 30, 2006, 12:14 PM

              Quote from: Mats at Apr 27, 2006, 02:34 PM

              3) A monthly archive, listing the month and year in a list like this. Also listed in the sidebar column :

              - April 2006
              - March 2006
              - February 2006

              And when all the selected month’s blog posts are listed, I want to paginate them and show... say 10 posts on each page.
              I can’t understand how I can do it, is it possible?

              Set summarize to 0 and showarch to 1.
              Thanks Mark, and how can I see the archive divided in months?
                Sorry for my bad English grin
                • 33688
                • 54 Posts
                Quote from: Mark at Apr 30, 2006, 10:24 PM

                Quote from: edipo at Apr 30, 2006, 12:14 PM

                Quote from: Mats at Apr 27, 2006, 02:34 PM

                3) A monthly archive, listing the month and year in a list like this. Also listed in the sidebar column :

                - April 2006
                - March 2006
                - February 2006

                And when all the selected month’s blog posts are listed, I want to paginate them and show... say 10 posts on each page.
                I can’t understand how I can do it, is it possible?

                Set summarize to 0 and showarch to 1.
                Okay, if I make this basic NewsListing call:
                [[NewsListing? &startID=`9` &summarize=`0` &showarch=`1`]]

                ...what else do I need to put in to create a monthly archive like this (see right column under "Arkiv")?
                  • 18397
                  • 3,250 Posts
                  Sorry, I forgot for a moment there that I programmed NewsListing to display everything when summarize was set to 0. To make this work, remove this line (should be 359 in NL 6.4.2):

                  if ($nrposts == 0) {$nrposts = $recordcount + 1;}
                  


                  ... in a copy of NewsListing. Do not edit NewsListing itself as it will be overriden with each upgrade. Then you above call should work.
                    • 33688
                    • 54 Posts
                    Thanks, Mark! Very much appreciated.

                    Did I tell you how awesome I think the NewsListing snippet is? For the website I’m building it’s absolutely essential. I hope you will continue to add features to it, but don’t forget to stop once in a while (as a true scientist) to document your developments! wink

                    Cheers!
                    Mats
                      • 8471
                      • 333 Posts
                      Thanks Mark! NewsListing is great! wink
                        Sorry for my bad English grin