Navigation

Quick and Dirty Way to Determine X and Y Coordinates

Sometimes Tridion content authors need to enter X and Y coordinates to position an element within an image, content or on a page. I believe there are often better ways to handle such positioning requirements including a mix of:
  • Automatic for authors:
    • Styles (e.g. automatic placing presentations)
    • Relying on inline flow and block elements (e.g. placing selections and items in order from top-to-bottom or left-to-right)
    • Making the entire component presentation, image, or area clickable rather than a specific (hot) spot
  • Higher-level selections for authors:
    • Relative positioning where authors choose something easier to understand than coordinates (e.g. top, right, bottom, left)
    • Templates (for a few options, we don't want dozens of templates but "left" and "right" options could be reasonable)
But if you find yourself entering such “Battleship” fields, especially within an image, here’s a quick tip using Window’s MS Paint or another image editing program.

Paint

Paint’s status bar will show you dimensions as well as X and Y in pixels as you move your mouse over an open image.



Be sure Status bar is on. Turning on Rulers and Gridlines is optional, but can also help.


Paint.NET



After entering X and Y, simply Save & Close your component or page, then republish from the Content Manager Explorer or Update Preview in Experience Manager.

If you find coordinates seem flipped or rotated, simply rotate or flip the image to get the right numbers. Otherwise, try your best to get the coordinates from whoever makes the images.

If you find selecting coordinates is critical for your content model consider a GUI extension of sorts. For a great example, see John Winter’s Image Map selection that saves user selections into Tridion fields.

No comments:

Post a Comment

Feel free to share your thoughts below.

Some HTML allowed including links such as: <a href="link">link text</a>.