Okay, I’m experimenting today, and I’ve run into a snag trying to implement a TV icon; getting a parse error here:
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: Invalid argument supplied for foreach()
Error type/ Nr.: Warning - 2
File: /home/.ZZZZZZ/ZZZZZZZ/ZZZZZZZZ.org/assets/snippets/newslisting/functions.php
Line: 72
Line 72 source: foreach ($tvs as $name=> $object) {
I’ve uploaded the latest snipped w/ no changes. Here’s my tpl chunk:
<div class="Item">
[+tvsectionicon+]<h1 class="ItemTitle">[+title+]</h1>
<div class="ItemBody">[+summary+]
</div>
<div class="ItemMoreLink">[+link+]
</div>
<div class="ItemFooter><span class="ItemAuthor">Posted by [+author+]</span> on <span class="ItemDate">[+link+][+date+]</span>
</div>
</div>
...and I’m calling it from the page as follows:
[!NewsListing?startID=18&summarize=20&hidefolders=1&multilevel=1&truncLen=50&tpl=nl-item-tpl!]
I’ve got the TV set up as an image widget, template access set to the template, and document permissions set for all. The default value is set to @INHERIT. The very root folder has an image value set, and 2 of my test sub-folders have images set, and everything else shows up as @INHERIT, like I’d expect.
Removing the [+tvsectionicon+] allows the snippet to work.
Removing the default value of @INHERIT doesn’t help.
So I guess now I’m confused. :P This is my first foray into TVs, so I might be missing something, but it all looks correct after picking through the docs and the examples.
Any pointers as to where I can look next for something I screwed up?
EDIT: BTW, the TV is actually named "sectionicon" and not "tvsectionicon"