mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Putting the widget layer hinting notification into it's own feature...
...so it can be disabled when it becomes annoying. It's enabled by default in the blog and default recipies. --HG-- branch : dev
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
|
||||
XmlRpc,Orchard.Blogs.RemotePublishing,
|
||||
TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
|
||||
Orchard.jQuery,Orchard.Widgets,
|
||||
Orchard.jQuery,Orchard.Widgets,Orchard.Widgets.PageLayerHinting,
|
||||
Orchard.Scripting,Orchard.Scripting.Lightweight,
|
||||
PackagingServices,Orchard.Packaging,Gallery.Updates,
|
||||
TheThemeMachine" />
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
|
||||
Orchard.Lists,TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
|
||||
Orchard.jQuery,Orchard.Widgets,Orchard.ContentTypes,
|
||||
Orchard.jQuery,Orchard.Widgets,Orchard.Widgets.PageLayerHinting,Orchard.ContentTypes,
|
||||
Orchard.Scripting,Orchard.Scripting.Lightweight,
|
||||
PackagingServices,Orchard.Packaging,Gallery.Updates,
|
||||
TheThemeMachine" />
|
||||
|
||||
@@ -8,10 +8,12 @@ using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Widgets.Drivers {
|
||||
[OrchardFeature("Orchard.Widgets.PageLayerHinting")]
|
||||
public class LayerHintHandler : ContentHandler {
|
||||
public LayerHintHandler(IOrchardServices services, RequestContext requestContext) {
|
||||
T = NullLocalizer.Instance;
|
||||
@@ -19,6 +21,9 @@ namespace Orchard.Widgets.Drivers {
|
||||
OnPublished<RoutePart>((context, part) => {
|
||||
if (string.IsNullOrWhiteSpace(part.Path)) // only going to help in creating a layer if the content has a path
|
||||
return;
|
||||
|
||||
|
||||
|
||||
var urlHelper = new UrlHelper(requestContext);
|
||||
var pathForLayer = "~/" + part.Path;
|
||||
services.Notifier.Information(T("Would you like to <a href=\"{0}\">add a widget layer</a> for \"{1}\"?",
|
||||
|
||||
@@ -8,3 +8,9 @@ Description: An implementation of widgets for Orchard.
|
||||
FeatureDescription: An implementation of widgets.
|
||||
Category: Widget
|
||||
Dependencies: Orchard.Scripting, Orchard.Themes
|
||||
Features:
|
||||
Orchard.Widgets.PageLayerHinting:
|
||||
Name: Page Layer Hinting
|
||||
Description: Adds a notification after creating a new Page with a direct link to create a Widget Layer for that specific page by URL.
|
||||
Dependencies: Orchard.Widgets
|
||||
Category: Widget
|
||||
|
||||
Reference in New Issue
Block a user