Announcements
Dear community,
How to center an image with the width of the gallery template
Tried: (Parent.Width -Parent.TemplateWidth)/2
But no luck
Gr.P
Parent.Width/2-Self.Width/2
thats for a vertical gallery, with only 1 column. If you have ahorizontal gallery, or a vertical that has multiple columns (you changed the wrapcount) then youd need
Parent.TemplateWidth/2-Self.Width/2
@PeKi72
X = (Parent.TemplateWidth - Self.Width) / 2
Y= (Parent.TemplateHeight - Self.Height) / 2
If this is the answer for your question, please mark the post as Solved.If this answer helps you in any way, please give it a like.
Thanks!
Thanks gcmFaizan. It was nice to know that the code was for the x and y axis. It works great.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 393 Super User 2026 Season 2
Mohsin Ali 328
WarrenBelz 278 Most Valuable Professional