一个组件的缠绕元件上动态地插入一类名 [英] Inserting a class name dynamically on a component's wrapping element

查看:169
本文介绍了一个组件的缠绕元件上动态地插入一类名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 CQ:htmlTag 来生成的组件之一的自定义标签。

I am using a cq:htmlTag to generate a custom tag for one of the components.

有关阶级的属性,我知道,我可以提供一个静态的类名是一个CSS文件的一部分,但我的要求是要有模板名称作为类属性值。

For the "class" property, I know that I could provide a static class name that is part of a CSS file, but my requirement is to have the 'template name' as the class property value.

CQ是否提供了一种使用动态值?

Does CQ provide a way to use dynamic values?

推荐答案

开箱我不这么认为。有几个解决方法,我能想到的:

Out of the box I think not. There are a few workarounds that I could think of:

  • 添加其他标签作为一个孩子,你设置的类别(可能不是你想要的)
  • 使用JavaScript来负载增加它(如果它不迟到)
  • 叠加的parsys并实现你的逻辑有

这篇关于一个组件的缠绕元件上动态地插入一类名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆