I have the following code in my template:
{% include "entry_table/cell.html" with data_items = data_fields class="entry_table_title" only%}
Which gives me the following error:
"with" in 'include' tag needs at least one keyword argument.
I've tried replacing data_field (which is a variable I passed into the context) with a string, just in case that was what was causing the problem, but even if I make it:
{% include "entry_table/cell.html" with data_items = "unicorn" class="entry_table_title" only%}
I still get the same error. The only thing that fixes the issue is to get rid of data_items completely, as in:
{% include "entry_table/cell.html" with class="entry_table_title" only%}
So, what's the problem?
NOTE: I just realized that data_items is also a variable that is passed into the context of the page that is calling the other template, but when i changed the name to something else, it still didn't work. So that is not the problem.
Looks like Django is quite picky about whitespace in this instance. If I change...
{% include "entry_table/cell.html" with data_items = data_fields class="entry_table_title" only%}
...to...
{% include "entry_table/cell.html" with data_items=data_fields class="entry_table_title" only%}
...it works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With