Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Hi Team,
I'm trying to create a component which has the resource type as
cq/gui/components/coral/common/form/tagfield
I want to retrive this component values on page like text filed. Is there a way to do this. Getting tag values from component not from page properties.
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
In your sling model you can use TagManager API to read tag values.
@SlingObject private ResourceResolver resourceResolver; @ValueMapValue private String tagName; //tag field name from your component dialog TagManager tagManager = resourceResolver.adaptTo(TagManager.class); Tag tag = tagManager.resolve(tagName); String tagTitle = tag.getTitle(); String tagId = tag.getId();
More details on TagManager API can be found in below javadoc.
Vistas
Respuestas
Total de me gusta
In your sling model you can use TagManager API to read tag values.
@SlingObject private ResourceResolver resourceResolver; @ValueMapValue private String tagName; //tag field name from your component dialog TagManager tagManager = resourceResolver.adaptTo(TagManager.class); Tag tag = tagManager.resolve(tagName); String tagTitle = tag.getTitle(); String tagId = tag.getId();
More details on TagManager API can be found in below javadoc.
Vistas
Respuestas
Total de me gusta
Do you want to read them from the component and display on the page as text ?
If that is the case which one do you want to display is it tagname or tagId ?
Can you explain more on this ?
Vistas
Respuestas
Total de me gusta
Hi @Mani_kumar_ Thanks for your response. Yes I want to read tags through component and I just want to display only the name of the tag on page.
Vistas
Respuestas
Total de me gusta
If that is the case as mentioned by @salamswapnil use Tagmanager API read name from the parsed Tag object it should solve your problem.
Vistas
Respuestas
Total de me gusta
How to get tag from tagging. I want industry, sector and country tag name How I'll get, How I write sling model. @arunpatidar @BrianKasingli
Vistas
Respuestas
Total de me gusta
Hi @iamsumansourav
@salamswapnil has already provided the code sample, to get tag name from tag id.
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas