Okay, so what I’m trying to do is something like this:
snippet #1
content
snippet #2
which is simple enough. But snippet #2 needs information that snippet #1 generates. Is there any way to let snippet #2 have information from snippet #1? Or am I just basically screwed and there’s no chance of that ever happening?
So do I use that by setting the placeholder in snippet 1 and then getting it in snippet 2? And if that is how it works, is that all there is to it?
Yes and Yes. There might be an easier way (globals?) but you’d have to ask Raymond or Jason about that (our code Guru’s)
Thank you sooo much!
*goes off to try it out*
Actually still having a bit of a problem.. Where snippet #1 should be I get the error
Parse error: parse error, unexpected T_STRING in /home/neolodge/public_html/dev/manager/includes/document.parser.class.inc.php(691) : eval()’d code on line 58
and where snippet #2
Parse error: parse error, unexpected T_STRING, expecting ’(’ in /home/neolodge/public_html/dev/manager/includes/document.parser.class.inc.php(691) : eval()’d code on line 3
Oh I didn’t know I needed the modx-> part in front.. I’ll try that now.
Okay well now it looks like it’s almost working.. is there anything special I need to do if the thing I need to send is an array? Because now it’s looking like my error is because it is an array.
I have no idea whether or not placeholders support arrays...
You can either try setting a global (no idea how that works) or turning your array into text and using an explode function in snippet 2 to turn it into an arrary.
The best thing to do is to have snippet 1 do all the work and output what snippet 2 should display as a placeholder. Then you could just do this:
[[snippet1]]
content
[+snippetoutput+]
which is alot cleaner and faster.