Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you add images or icons to the Item Template? #77

Open
craigmday opened this issue Jul 23, 2024 · 3 comments
Open

Can you add images or icons to the Item Template? #77

craigmday opened this issue Jul 23, 2024 · 3 comments

Comments

@craigmday
Copy link

Hi,

Is it possible to add images or icons to an Item Template? There is an existing post for this, but the solution did not appear to work and there was no further feedback.
#59

Can anyone confirm if they have gotten this to work and how it was accomplished? Ideally, I would like to be able to add an edit icon like the "Pencil" icon in PowerApps.

@brendanerofeev
Copy link

brendanerofeev commented Jul 24, 2024

I use an image icon for a button Here is my code.

<button class="action-openrecord" style="min-width: 45px; min-height: 45px; border-style:none; background-color:#ffffff00; background-size:contain; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAADaxJREFUeF7tnV1SG8kShasEs44rVnIhLBgWgCL8ZlgJeCUwb44QC8AgAmYl6K7DEnWjZXAwY36q+k99Mj8/V1dnnpP5KbvURjHwDwVQwK0C0W3mJI4CKBAAAEWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQA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g/G0lV1Z/Gj2GsFsnePUDwLX/dRIf2jU0f74jJT8Smr+rv5UWxn8zANifTO9qUdzZ2E/ztwcqKz+gKj8BvPdTV+/a7az5Ky1qg7K9vjGxk5VPfxMTQMlLG7+qz2HzV7lnf79tok27ScLCV38vlTEwAWS+tPHr6HazP9HdTVl+vCvj/8cafbjCwIs//85RHgBFY63TT/7K9EYHpR92hoMFRmtHHgDZ/3HDqIG5rQcAcpX6fZ21sd/UI0BWYTtv/mfD67zsUr9trFyZzq7nl1+tZGPuEWB9uv3e+9s0/z88r/2tidUOeDOvdDba3v7r6urbwnLq8o8Az+ZUk0D6sTpdv9mVws+322K6sEzvuoVZHQiuQjyt9e5E3ZsO9boU1g2eYljEkO5TjP+7uZldDDXctuMyA4C2hWE/FPCgAADw4DI5osAbCgAASgMFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgL/BwpRoIguAd0cAAAAAElFTkSuQmCC');"> </button>

Which produces

image

@craigmday
Copy link
Author

craigmday commented Jul 24, 2024

Hi Brendan,

Thank you very much for the quick reply. I tried using your sample, but unfortunately I still don't see an image. This is the full ItemTemplate code that I am using:

"
<div 
Style = '
min-width: 32px;
min-height:64px;
align-items: left;
background-size: contain;
justify-content: center;
font-size: 10px;
font-weight: 600;
padding-left: 10px;
color: RGBA(0,0,0,.90);
{{#if TaskDispatched}} 
background-color: RGBA(0,100,0,0.18);
{{else}}
background-color: RGBA(245,217,39,0.8);
{{/if}}
{{#if TaskSnoozed}} 
background-color: RGBA(155,65,197,0.29);
{{/if}}
'>
{{#if TaskDispatched}}** DISPATCHED ** <br>{{/if}}
{{#if TaskSnoozed}}** SNOOZED ** <br>{{/if}}
{{JobDescription}}<br>
{{dyn365bc_description}}<br>Est. Hours: {{dyn365bc_estimatedhours}}
<br>{{JobType}}</br>
<button class='action-edit' style='min-width: 45px; min-height: 45px; border-style:none; background-color:#ffffff00; background-size:contain; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAADaxJREFUeF7tnV1SG8kShasEs44rVnIhLBgWgCL8ZlgJeCUwb44QC8AgAmYl6K7DEnWjZXAwY36q+k99Mj8/V1dnnpP5KbvURjHwDwVQwK0C0W3mJI4CKBAAAEWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBAEANoIBjBQCAY/NJHQUAADWAAo4VAACOzSd1FAAA1AAKOFYAADg2n9RRAABQAyjgWAEA4Nh8UkcBNwA4PPw8Dsvl+DGE/6YQd2MK4xDDmBJwrkAKi0qBFMNilMLicRT+vrmZXXhRxTwAqsZ/XC6/hBDPvJhKng0VSGERQ7iPf2x9vbr6tgaE1X+mAXAwO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f79tok27ScLCV38vlTEwAWS+tPHr6HazP9HdTVl+vCvj/8cafbjCwIs//85RHgBFY63TT/7K9EYHpR92hoMFRmtHHgDZ/3HDqIG5rQcAcpX6fZ21sd/UI0BWYTtv/mfD67zsUr9trFyZzq7nl1+tZGPuEWB9uv3e+9s0/z88r/2tidUOeDOvdDba3v7r6urbwnLq8o8Az+ZUk0D6sTpdv9mVws+322K6sEzvuoVZHQiuQjyt9e5E3ZsO9boU1g2eYljEkO5TjP+7uZldDDXctuMyA4C2hWE/FPCgAADw4DI5osAbCgAASgMFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgIAgBpAAccKAADH5pM6CgAAagAFHCsAABybT+ooAACoARRwrAAAcGw+qaMAAKAGUMCxAgDAsfmkjgL/BwpRoIguAd0cAAAAAElFTkSuQmCC');'></button>
</div>
"

And the result looks like the attached image.
ItemTemplate Image Sample

Also, I'm curious how you were able to use double quotes around your button controls because I found I had to use single quotes, since I had double quotes around the entire ItemTemplate code. Would you mind sharing a screenshot of how this button code looks embedded with your other ItemTemplate code?

Thanks again,
Craig

@craigmday
Copy link
Author

UPDATE: I got this working by using double sets of double quotes within the template definition. Thank you very much, Brendan!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants