Sub topic 15
Linking Layers to Move Them Together
This chapter assumes you can open a document, find the Layers panel, select layers, and use the Move tool. You should also know the difference between a pixel layer and a vector shape layer. Here you will learn what linking does, when it is the right tool, and where it goes wrong.
What linking does
Linking ties two or more layers together so that transform operations applied to one are applied to all of them. Moving a linked layer moves its partners. Scaling or rotating with Free Transform (Ctrl/Cmd+T) affects the whole linked set as well.
Linking does not change the stacking order, the visibility, or the blend settings. It also does not create a container. Linked layers can sit anywhere in the stack, even far apart, and they can live in different groups. This is the main difference between linking and grouping.
| Feature | Linking | Grouping |
|---|---|---|
| Creates a container in the stack | No | Yes |
| Layers must be adjacent | No | Yes, when you create the group |
| Moves layers together | Yes | Yes |
| Shares a blend mode, opacity, or mask | No | Yes |
| Collapses to save panel space | No | Yes |
| Shows state in the panel | A chain icon on each linked layer | A folder row |
Creating and removing links
- Select two or more layers in the Layers panel. Click the first, then Ctrl/Cmd+click the others, or Shift+click to select a range.
- Click the chain icon at the bottom of the Layers panel. You can also use Layer > Link Layers.
- A chain icon now appears next to each linked layer's name.
To remove a link, select one of the linked layers and click the chain icon again, or choose Layer > Unlink Layers. Unlinking acts on the selected layers only. Other layers stay linked to each other.
To select every layer in a linked set, select one of them and choose Layer > Select Linked Layers. This is useful when the set is scattered through a long stack and you cannot see all the chain icons at once.
To pause a link without breaking it, Shift+click the chain icon beside a linked layer. The chain gets a red X, and that layer temporarily stops following the others. Shift+click again to restore it.
A worked example
Suppose you are building a poster with a badge. The badge is a circle shape layer, a text layer reading "NEW", and a small star on a pixel layer. They need to stay in a fixed arrangement, but you want them to remain separate layers in different places in the stack. The text must sit above a lighting group, while the circle stays below it.
- Select the circle, the text, and the star.
- Click the chain icon. All three now show chain icons.
- Select the Move tool and drag any one of them. All three move.
- Press Ctrl/Cmd+T. The transform box surrounds all three layers. Hold Shift and drag a corner to scale the badge proportionally.
Because the layers are only linked, you can still change the opacity of the star alone, or hide the text, without touching the others.
Linking versus selecting
Selecting several layers also lets you move them together. Linking stores that relationship in the file, while a selection disappears as soon as you click elsewhere.
- Use a selection for a one-off move.
- Use linking when you will come back to the same set several times, or when a collaborator opens the file later.
Photoshop also has an Auto-Select option on the Move tool. If it is set to Layer, clicking the canvas selects the layer under the cursor. If you click a linked layer, the other layers in its set move with it, though they are not highlighted in the panel. Choose Group in Auto-Select if you prefer to click an element and have its whole group move.
Common problems
A layer moves when you did not expect it to
This is the most common problem. A link made weeks ago is easy to forget. Look for chain icons in the panel. If a layer is moving along with another one, select it and check Layer > Select Linked Layers to see its partners.
A locked layer in the set
Locking affects whether a layer can be changed. A layer with Lock Position on cannot be moved, and Photoshop will not move it with its linked partners. The other layers move, and the locked one stays behind, which breaks the arrangement. Check the lock icons before moving a set.
Hidden layers still follow
A hidden layer remains linked. If you move the set, the hidden layer moves too. When you reveal it later, it is in the new position, which is usually what you want, but it can surprise you if you expected it to stay put.
Links and the Background layer
The Background layer cannot be moved or transformed freely, so it cannot be part of a useful linked set. Convert it to a regular layer first by double-clicking it and confirming the dialog.
Links across groups
Linked layers can be in different groups. Moving them works as expected. However, moving a whole group by dragging its folder moves its contents, including any linked layers inside. A linked partner outside the group does not move with it. Check this if your badge falls apart after you move a group.
When to use something else
Linking is a light tool. Two other options are often better.
- Groups. If the layers are adjacent and you want to collapse them, apply a shared blend mode, or add a single mask, make a group.
- Smart Objects. If you want to scale or filter the set as a single object, convert the layers to a Smart Object. The layers are stored inside it, and you can edit them later by double-clicking.
Linking works best when the layers must stay apart in the stack but still need to travel together.
Scripting links
ExtendScript exposes linking through the link method on a layer. This script links a text layer to a shape layer, assuming the active document has layers named "Badge" and "Label".
// ExtendScript (.jsx): link two named layers so they move together
var doc = app.activeDocument;
var badge = doc.artLayers.getByName("Badge");
var label = doc.artLayers.getByName("Label");
badge.link(label);
// To remove the link later:
// badge.unlink();The link method takes the layer to link with. If either name does not exist, getByName throws an error, so check your layer names first. Note that getByName on artLayers only finds layers at the top level of the document. For a layer inside a group, call it on that group's artLayers collection.
Exercise
You linked a circle layer and a text layer, then dragged a folder containing only the circle. The text layer did not move, even though it is still linked. What is the likely explanation, and how would you fix the arrangement?
Show answer
Dragging a group folder moves the layers inside that group. A layer outside the group, such as the text layer, was not moved, even though it is linked. Fix it by moving the text layer back into the same group, or by selecting both layers (Layer > Select Linked Layers) and moving them with the Move tool instead of dragging the folder.
Exercise
A linked set of three layers will not move as a whole. Two of them move and one stays in place. Name one likely cause and one way to check it.
Show answer
The one that stays is probably locked with Lock Position, or its link is paused (a red X on the chain icon). Check the lock icons in the Layers panel and the chain icon next to each layer, then unlock the layer or Shift+click the chain to restore the link.