![]() |
Template Problem
Hello, I'm attempting to port a mod (someone else's) to VB4 and I'm having a problem with one of the templates.
The mod has a main templates and calls the other templates using variables. I modified the main template and the php file so that the variables are now registered and the sub templates are called using the {vb:raw } syntax. The problem is in one of the sub templates I need to pass variables to it as well but as soon as I try to specify a {vb: } type variable (even stylevars) it won't let me save the template. I get the following error: Code:
Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3332 https://vborg.vbsupport.ru/external/2010/05/57.png Any any ideas where the problem might be? Thanks. EDIT: I checked and as far as I'm aware of there are no if statements in the template. |
What is the code you are adding that seems to be causing the problem?
|
Quote:
I found a work around though. There was some javascript in the template so I pulled all of it out and put it into a new template then called IT from the main template and now I can save the original template without error. EDIT: The problem is definitely in the javascript somewhere. The javascript is needing variables from the PHP file but when I try to reference the variable using {vb:raw variablename} i get the same error when I save the template. I poked through the javascript and everything LOOKS ok but I'm no expert. Is there anything I should keep an eye out for? |
I had a similar error pop up not so long ago. Check that the "<vb:if condition>" tags are all written correctly, since that's what caused the same error when I was porting templates and had missed one.
In vB3 it's: <if condition="...."><else /></if> In vB4 it's: <vb:if condition="...."><vb:else /></vb:if> |
Quote:
I'm not using HTML <if> statements though. The template in question consists entirely of javascript (with the addition of the <script></script> tags). How would that apply? |
You might wanna post the template here then (or the offending part) otherwise we can't help much.
|
Ok this is enough to generate the issue
Code:
<script type="text/javascript"> |
put <vb:literal> and </vb:literal> around your javascript.
|
Lynne, That seems to have fixed it. Thanks a bunch. :D
|
All times are GMT. The time now is 10:37 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|