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

Hide the "Links" box when there are no links #3106

Merged
merged 1 commit into from
Oct 3, 2018

Conversation

abjerner
Copy link
Contributor

@abjerner abjerner commented Oct 1, 2018

We're usually having some content types that aren't directly accessible from the website, and therefore it doesn't really make sense to show the Links box under the Info tab as the URL doesn't work anyways.

With the SendingContentModel event, we can make sure that the box doesn't contain any links:

EditorModelEventManager.SendingContentModel += (sender, e) => {
    e.Model.Urls = null;
};

But the box is still being shown. With this PR, the Links box will be hidden when node.urls is either null or empty.

Before:
image

After:
image

@ghost ghost assigned abjerner Oct 1, 2018
@dawoe
Copy link
Contributor

dawoe commented Oct 1, 2018

LOL.. I had this on my list as well. I have this as example in my Duugfest talk next friday and I also noticed the links box is there.

But code looks good to me.

Dave

Copy link
Contributor

@dawoe dawoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nul800sebastiaan I can confirm this fixes the issue

@nul800sebastiaan
Copy link
Member

Yes it does! 👍

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.

3 participants