We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36446
    • 184 Posts
    Hi!
    I recently discovered GoodNewsContentCollection for the phantastic Newslettersystem GoodNews for modx.

    This is a really great feature to create newsletters fast and easy but unfortunately i'm not able to add TVs to this contentcollection. I tried all different variations like:
    [[*tepmplatevar]] [[+tv.templatevar]] [[+templatevar]]

    even added: &processTVs=`1` and includeTVs=`1` to the call (because somewhere it's mentioned that this snippet is similar to the getressources snippet - but without any luck. Does anyone know if it's possible to add template Variables to this? Would be so phantastic!!

    Thanks!
    Sven







    This question has been answered by multiple community members. See the first response.

    [ed. note: flanger last edited this post 6 years, 5 months ago.]
      https://www.beautyislife-shop.de - premium make-up!
      https://www.topsterne.de - sell it here!
      ---------------------------------------------------------
    • discuss.answer
      • 10378
      • 375 Posts
      Hi Sven,

      the contentCollection snippet currently doesn't support TVs. But it's already on my list!

      Here is a list of supported params:
      http://www.bitego.com/extras/goodnews/goodnews-implementation/contentcollection-snippet.html

      In the meantime you could additionally use the getResourceField add-on to fetch TV values:
      https://docs.modx.com/extras/revo/getresourcefield

      Code sample for a contentCollection row template with getResourceField

      <table border="0" width="100%" cellpadding="0" cellspacing="0" class="collectionrow" bgcolor="#ffffff">
          <tr class="collectiontitle">
              <td bgcolor="#ffffff" style="background-color: #ffffff; padding-bottom: 5px; font-size: 18px; line-height: 24px; font-family: Helvetica, sans-serif; color: #333;">
                  <a href="[[+url]]" style="color: #9ec41a;"><span style="color: #9ec41a;">[[+pagetitle]]</span></a>
              </td>
          </tr>
          <tr class="collectionbody">
              <td bgcolor="#ffffff" style="background-color: #ffffff; font-size: 16px; line-height: 22px; font-family: Helvetica, sans-serif; color: #333;">
                  [[+content:notags:ellipsis=`200`:default=`[[+introtext:ellipsis=`200`]]`]]
              </td>
          </tr>
          <tr class="collection footer">
              <td bgcolor="#ffffff" style="background-color: #ffffff; font-size: 16px; line-height: 16px; font-family: Helvetica, sans-serif; color: #333;">
                  [[getResourceField? &id=`[[+id]]` &field=`myTV` &processTV=`1`]]
              </td>
          </tr>
      </table>
      <br>
      


      (didn't test this code but should work!)
      (and BTW, in case anyone wonders about the HTML code quality: this is a template for an email newsletter)

      Hope this helps!

      Greetings,
      Martin [ed. note: gadgetto last edited this post 6 years, 5 months ago.]
        Freelancer @bitego http://www.bitego.com
        ---
        GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
        More infos here: http://www.bitego.com/extras/goodnews/
      • discuss.answer
        • 36446
        • 184 Posts
        Hey Martin!
        Great solution! Works just fine! Now Newsletter creation with modx is becoming a breeze! Really cool!!!

        Even more complex -but still automatically created - Layouts are possible. We can just use 2 (or more) collections and assign different template Variables. I'm thrilled!

        Thanks a lot! [ed. note: flanger last edited this post 6 years, 5 months ago.]
          https://www.beautyislife-shop.de - premium make-up!
          https://www.topsterne.de - sell it here!
          ---------------------------------------------------------