We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    Is there a way to assign a class to just the page title when it is outputed by the NewsListing snippet?  What I want to do is have a style class to assign a background image and a CSS border to the title as it sits just above the summary. 

    eg:

    ---------------------------------------------------------------------
    |  Article Name                                                                 |
    ---------------------------------------------------------------------
       This is the content of the article.  Lorem ipsum dollar sign sit onit!

    ---------------------------------------------------------------------
    |  Article 2 Name is just as good                                   |
    ---------------------------------------------------------------------
       This is the content of article 2.  Isn’t it lovely and insightful?



    Any ideas?

    -sD-
    scotty Delicious
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
    • Super easy to do... but I’ve got to spend some time with the wife... so it’ll have to wait until later this weekend. Good night!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 18397
        • 3,250 Posts
        Just create a new chunk using the proper placeholders (look in the comments part of the snippet) and call it appropriately.
          • 26435
          • 1,193 Posts
          Quote from: Mark at Oct 29, 2005, 05:07 AM

          Just create a new chunk using the proper placeholders (look in the comments part of the snippet) and call it appropriately.

          ok, I found it in the comments. I copied and pasted the $tpl code in the snippet to a new chunk, but I can’t figure out how to call it. It is saved as {{BlogHeader}}, and I tried to call it with and without the brackets, but neither works. I am sure the answer is simple... and yes, I know I am a dumbass.

          -sD-
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
          • Look at the demo site content for examples of how to do this.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 33337
              • 3,975 Posts
              here is quick example.

              1. Given below code, save as chunk:
              <div style="border: 1px solid #000;"><h2>[+title+]</h2></div>
              <div>[+summary+]</div>
              <div>[+link+]</div>
              


              2. Call it as:
              [[NewsListing? &tpl=`chunk_name_goes_here`]]
              


              I hope you will find it helpfull.

              regards,

              zi
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 26435
                • 1,193 Posts
                Quote from: zi at Oct 29, 2005, 06:43 PM

                [[NewsListing? &tpl=`chunk_name_goes_here`]]
                


                I hope you will find it helpfull.

                regards,

                zi

                So, if my chunk is named headstyle, and I wanted to call in in an html page, I would put {{headstyle}} in the content of the page.
                But, if I want to call it in the NewsListing snippit, is it called like this:
                [[NewsListing? &tpl=`headstyle`]]
                

                or like this:
                [[NewsListing? &tpl=`{{headstyle}}`]]
                


                -sD-
                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 18397
                  • 3,250 Posts
                  This

                  [[NewsListing? &tpl=`headstyle`]]
                  


                  Note that the chunk used as the template for each news item outputted by the snippet so it must contain the appropriate placeholders.
                  • Take a look at the WebLoginSideBar chunk for a good example of this.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 26435
                      • 1,193 Posts
                      Well, I figured out why I couldn’t get it to work. I was using the single quote ( ’ ) instead of the tick ( ` ) which is next to the 1 key. So... there’s my lesson for the day! Pay attention Scotty!

                      -sD-
                        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                        All of the above... in no specific order.


                        I send pointless little messages