We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29877
    • 35 Posts
    I can’t imagine why this would not work, but I am having trouble using template variables inside of a chunk.

    Here is what I have laid out within the scope of my issue:


    "Careers" page

    - Uses ditto call to display job opportunities

    - [!Ditto? &startID=`290` &sortBy=`title` &sortDir=`DESC` &;tpl=`careers`!]

    - ID 290 is the Careers document in MODx, with each job opportunity as a separate document inside.

    - I’m using the following template variables: careerdate (date), careercity (text) and careerdepartment (text).


    The chunk "careers", that is within my ditto call is as follows:

    <div>
    <div style="float: left; width: 250px;"><a href="[~[+id+]~]">[+title+]</a></div>
    <div style="float: left; width: auto;">[*careerdepartment*]</div>
    <div style="float: right; text-align: right; width: 150px;">[*careercity*]</div>
    </div>


    While viewing the Careers page, my two template variables that I’m calling do NOT display. The ID and Title do display correctly.

    You can view the Careers page for yourself here: http://www.nettrekker.com/about-us/careers. I may resort to putting the missing text back in manually for the time being - if you’re viewing it and see the missing information.

    Help on solving this would be much appreciated. Thanks!
      • 26931
      • 2,314 Posts
      Hi,

      you probably need to call the TVs in the chunk like that:
      <div>
        <div style="float: left; width: 250px;"><a href="[~[+id+]~]">[+title+]</a></div>
        <div style="float: left; width: auto;">[+careerdepartment+]</div>
        <div style="float: right; text-align: right; width: 150px;">[+careercity+]</div>
      </div>

      and you got a little typo in "&;tpl=`careers`" -> &tpl=`careers`

      hope that helps smiley
        • 29877
        • 35 Posts
        Quote from: sharkbait at Aug 14, 2009, 01:26 PM

        Hi,

        you probably need to call the TVs in the chunk like that:
        <div>
          <div style="float: left; width: 250px;"><a href="[~[+id+]~]">[+title+]</a></div>
          <div style="float: left; width: auto;">[+careerdepartment+]</div>
          <div style="float: right; text-align: right; width: 150px;">[+careercity+]</div>
        </div>

        and you got a little typo in "&;tpl=`careers`" -> &tpl=`careers`

        hope that helps smiley

        Fantastic! That was it. I didn’t figure it was the answer, so I never bothered to try it myself before writing this.

        As far as the typo, thanks for pointing it out. Wasn’t in the actual code however.

        This discussion is closed to further replies. Keep calm and carry on.