-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add optional target='_blank' to the Menus and AdminMenus #15541
Comments
A way to do this directly in Orchard Core may be nice, but in the meantime you can do something like this in your code through a shape table provider. This is how I added public class Shapes : IShapeTableProvider
{
public void Discover(ShapeTableBuilder builder)
{
builder.Describe("NavigationItemLink__admin")
.OnDisplaying(displaying =>
{
string id = displaying.Shape.Id;
if (id == "some_menu_id")
{
displaying.Shape.Attributes.Add("target", "_blank");
}
});
}
} |
Do you mean to add an option for menu items to generate the anchor with target blank? |
Yes, the menu items of OC support external links, but we can only open them in the current window. |
Adding a settings will be useful where users can alternate between @hyzx86 will you submit a PR for this? |
I'm thinking about how to design this interaction... |
In some cases we need to always open external links in new pages
The text was updated successfully, but these errors were encountered: