Output HTML properties in HTL

Avatar

Avatar
Boost 1
Level 1
ksned
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
ksned
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
ksned
Level 1

01-02-2019

I have a use case for outputting single HTML properties (e.g. 'disabled', 'checked', 'somethingelse') in HTL. I've tried everything I can think of.

desired HTL

<input type='checkbox' ${checked} />

desired output HTML

<input type='checkbox' checked />

Replies

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-02-2019

Can you explain a bit more? The properties of an AEM Node or resource?

Avatar

Avatar
Boost 1
Level 1
ksned
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
ksned
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
ksned
Level 1

01-02-2019

Thanks for quick response!

Just looking to output a single HTML property, not a X=Y attribute pair. Really looking to output a simple string from any source. Does that help?

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
Gaurav-Behl
MVP

01-02-2019

try - <input type="checkbox" checked="${true}">

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

01-02-2019

That helps. Using HTL -- you can display values of dialog fields - based on Granite resource types. For example - a date field or checkbox. I recommend that you go through this entire document. You will learn a lot here:

Building Experience Manager Components using Granite/Coral Resource Types

Avatar

Avatar
Boost 1
Level 1
ksned
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
ksned
Level 1

Like

1 like

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
ksned
Level 1

01-02-2019

This is VERY close! My fault, I gave a poor example.
I need to do that, but:

<input type='checkbox' ${customProp} />

<input type='checkbox' customProp  />

so from your example it would be something like this (i know this is very wrong)

<input type="checkbox" "${customProp}"="${true}">

Make sense?

Avatar

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile

Avatar
Boost 250
MVP
Gaurav-Behl
MVP

Likes

250 likes

Total Posts

1,147 posts

Correct reply

283 solutions
Top badges earned
Boost 250
Establish
Give back 300
Give Back 50
Give Back 5
View profile
Gaurav-Behl
MVP

01-02-2019

correct