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

FIX Use PreviewLink of the owner object to preview blocks #982

Conversation

GuySartorelli
Copy link
Member

#871 allows ElementalArea to be added to any arbitrary DataObject. We should always try to set the correct preview link where possible. Some DataObjects may have a PreviewLink method for preview in the CMS, but no front-end link.

Finally, we should fallback to returning a null value if no link could be obtained for preview, so that the preview panel can correctly display a "no preview available" message.

Parent Issues

Related

@sabina-talipova
Copy link
Contributor

Could you add testing for PreviewLink, please.

src/Models/BaseElement.php Outdated Show resolved Hide resolved
src/Models/BaseElement.php Outdated Show resolved Hide resolved
@sabina-talipova
Copy link
Contributor

Just minor changes. Nice to have this enhancement!

@GuySartorelli GuySartorelli force-pushed the pulls/4.9/allow-empty-preview branch 2 times, most recently from 3910b4e to 5b78735 Compare May 11, 2022 23:22
@GuySartorelli GuySartorelli force-pushed the pulls/4.9/allow-empty-preview branch from 5b78735 to 24f6cde Compare May 12, 2022 01:14
@sabina-talipova sabina-talipova merged commit 38bd12b into silverstripe:4 May 12, 2022
@sabina-talipova sabina-talipova deleted the pulls/4.9/allow-empty-preview branch May 12, 2022 02:00
menno-rdmkr pushed a commit to busting-bytes/silverstripe-elemental that referenced this pull request Dec 15, 2022
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

Successfully merging this pull request may close these issues.

2 participants