Velocity ${variables} referenced in generated markup

10 views
Skip to first unread message

Mark Orciuch

unread,
Mar 11, 2021, 3:59:44 PM3/11/21
to dotCMS User Group
Hello,

When I inspect the markup generated by dotCMS, I see some unresolved Velocity variables (for example, "${columnClass}"). I see a reference to "columnClass" in template.vtl but I am not sure where such variable gets set? 

info.png

Many thanks in advance.

Mark Pitely

unread,
Mar 12, 2021, 10:46:50 AM3/12/21
to dot...@googlegroups.com
Mark,

I think that is supposed to be set when using the Template Builder (it's an option there to choose the column type).
If you made your own and bypassed the Template Builder, I'd add something like to the top of the template.vtl:
#if (!$UtilMethods.isSet($columnClass))
#set ($columnClasss="column-default")
#end

Hope that helps.

Mark Pitely
Marywood University

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b9ccc9b7-4e8a-4676-811e-1cca30ae0260n%40googlegroups.com.

Mark Orciuch

unread,
Mar 12, 2021, 12:33:56 PM3/12/21
to dotCMS User Group
Hi Mark,

Thanks, it makes sense now - I am using an advanced template.

Falzone, Chris

unread,
Mar 15, 2021, 9:37:17 AM3/15/21
to dot...@googlegroups.com
So you probably need to add a ! to suppress empty output.  $!{columnClass} instead of ${columnClass}.
Where it is in your template code, I don't think we can assist with that. 

Hope that helps! 



--

Christopher Falzone

DevOps Engineer

A Q U E N T  /  VITAMIN T

Mark Orciuch

unread,
Mar 15, 2021, 11:16:58 AM3/15/21
to dotCMS User Group
Hi Chris,

Sure, it does help. The biggest thing that I was missing is that this is related to using an advanced template.

Reply all
Reply to author
Forward
0 new messages