Skip to content
EnglishFrançais

Weak reference

A weak reference is a property (content) that points to another content item in the repository, such as an article’s image, the page a button links to or the file attached to a product sheet. The content item does not copy its target but designates it. If the target is deleted, the link leads nowhere.

Definition and how it works

Content reuse relies on referencing rather than copying. An image updated in the media library changes everywhere it is referenced. A button pointing to a page keeps working if the page’s title changes. In Content Editor, these links are filled in with pickers (image, file, page, content) rather than a hand-typed address.

The term comes from JCR (Java Content Repository), the storage standard on which Jahia’s repository (Content Repository) is built. A reference is called "weak" because it does not prevent its target from being deleted. The Academy documentation states that the picker then displays "Content not found". Developers declare these properties in the content type definition, for example with the weakreference type restricted to files.

Academy documentation: customizing Content Editor pickers

Weak reference vs content reference: the differences

A weak reference is a property inside a content item. A content reference is a content item in its own right, placed in a page to make another content item appear there.

The weak reference and its neighbors
ConceptWhat distinguishes it
Content ReferenceA content item of a specific type that points to a source content item, much like an alias or a symbolic link. It is inserted in a page like a component.
Picker (Content Editor)The picker (image, file, page, content) is the field used to fill in a weak reference. The reference is the stored value and the picker is the input tool.
Property (content)A weak reference is one property type among others, just like a text or a date.

Weak reference in practice

A campaign visual is used on dozens of pages and articles, each time through a reference to the same file in the media library. When the brand delivers a new version, the team replaces the file once. Once the new file is published, every page shows the new image without anyone reopening it.

The flip side is that content items referencing a file or a page lose their target if it is deleted. Check where it is used before deleting it.

Frequently asked questions

What happens if the content a reference points to is deleted?

A weak reference does not prevent its target from being deleted. Once the target is gone, the reference leads nowhere and the picker shows "Content not found" in Content Editor. On the website, the content’s view must handle this case cleanly, for instance by hiding the missing image rather than displaying an error.

Who decides what a weak reference can point to?

Developers, in the content type definition. That is where a property is declared as a weak reference, with a limit on what it can target if needed, for example files only. For the editorial team, it is a scoping topic. The team decides which fields point to the media library, which point to pages and which should stay free text.

Resources that cover this term

Explore related concepts

How to develop a DXP platform with the best UX for business users?

Explore this resource