forked from BlogEngine/BlogEngine.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
292 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...Engine/BlogEngine.NET/App_Data/datastore/widgets/c5535c01-4401-4b71-b9bb-8c3c794029d4.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<SerializableStringDictionary> | ||
<SerializableStringDictionary> | ||
<DictionaryEntry Key="author" Value="All" /> | ||
<DictionaryEntry Key="showdesc" Value="true" /> | ||
<DictionaryEntry Key="numberofposts" Value="10" /> | ||
<DictionaryEntry Key="showdate" Value="true" /> | ||
<DictionaryEntry Key="showimg" Value="true" /> | ||
<DictionaryEntry Key="sortorder" Value="Published" /> | ||
<DictionaryEntry Key="cutegory" Value="All" /> | ||
</SerializableStringDictionary> | ||
</SerializableStringDictionary> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
BlogEngine/BlogEngine.NET/App_Data/posts/5c7b53a5-5521-48c7-b922-c404a1b9448f.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?> | ||
<post> | ||
<author>Admin</author> | ||
<title>Post two</title> | ||
<description>This is a post two. The variables searchTerm and selectCommand are initialized at the top. You're go</description> | ||
<content><p>This post is just an example using Post List widget with image in the post body.</p> | ||
<p><img src="/image.axd?picture=/350x150.png" alt="" /></p> | ||
<p>Post List widget should find first image in the post body and display it in the post list when this option selected in the widget admin.</p></content> | ||
<ispublished>True</ispublished> | ||
<isdeleted>False</isdeleted> | ||
<iscommentsenabled>True</iscommentsenabled> | ||
<pubDate>2016-02-06 13:54:00</pubDate> | ||
<lastModified>2016-02-06 09:20:54</lastModified> | ||
<raters>0</raters> | ||
<rating>0</rating> | ||
<slug>post-two</slug> | ||
<tags /> | ||
<comments /> | ||
<categories /> | ||
<notifications /> | ||
</post> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
BlogEngine/BlogEngine.NET/Custom/Widgets/Page List/widget.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@using BlogEngine.Core | ||
@{ | ||
var title = "Page List"; | ||
} | ||
<div class="widget pagelist"> | ||
<h4 class="widget-header">@title</h4> | ||
<div class="widget-content"> | ||
<ul> | ||
@foreach (var page in BlogEngine.Core.Page.Pages.Where(page => page.ShowInList && page.IsVisibleToPublic)) | ||
{ | ||
var href = page.RelativeLink; | ||
if (BlogSettings.Instance.RemoveExtensionsFromUrls && !string.IsNullOrEmpty(BlogConfig.FileExtension)) | ||
{ | ||
href = href.Replace(BlogConfig.FileExtension, ""); | ||
} | ||
<li><a href="@href" title="@page.Description">@page.Title</a></li> | ||
} | ||
</ul> | ||
</div> | ||
</div> |
100 changes: 100 additions & 0 deletions
100
BlogEngine/BlogEngine.NET/Custom/Widgets/Post List/edit.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
@using BlogEngine.Core.Helpers | ||
@using BlogEngine.Core | ||
@{ | ||
var numberOfPosts = 10; | ||
var selCategory = "All"; | ||
var selAuthor = "All"; | ||
var selOrder = "Published"; | ||
var showImg = false; | ||
var showDesc = false; | ||
var showDate = false; | ||
|
||
var widgetId = Request.QueryString["id"]; | ||
var settings = WidgetHelper.GetSettings(widgetId); | ||
|
||
if (IsPost) | ||
{ | ||
settings["numberofposts"] = Request.Form["txtNumberOfPosts"]; | ||
settings["cutegory"] = Request.Form["ddlCategories"]; | ||
settings["author"] = Request.Form["ddlAuthors"]; | ||
settings["sortorder"] = Request.Form["ddlSortBy"]; | ||
settings["showimg"] = Request.Form["cbShowImg"] == "on" ? "true" : "false"; | ||
settings["showdesc"] = Request.Form["cbShowDesc"] == "on" ? "true" : "false"; | ||
settings["showdate"] = Request.Form["cbShowDate"] == "on" ? "true" : "false"; | ||
WidgetHelper.SaveSettings(settings, widgetId); | ||
} | ||
if (settings != null && settings.Count > 0) | ||
{ | ||
numberOfPosts = int.Parse(settings["numberofposts"]); | ||
selCategory = settings["cutegory"]; | ||
selAuthor = settings["author"]; | ||
selOrder = settings["sortorder"]; | ||
showImg = settings["showimg"] == "true" ? true : false; | ||
showDesc = settings["showdesc"] == "true" ? true : false; | ||
showDate = settings["showdate"] == "true" ? true : false; | ||
} | ||
|
||
var catList = new List<SelectListItem>(); | ||
catList.Add(new SelectListItem { Text = "All", Selected = selCategory == "All" }); | ||
foreach (var cat in Category.Categories) | ||
{ | ||
catList.Add(new SelectListItem { Text = cat.Title, Selected = cat.Title == selCategory }); | ||
} | ||
var authorList = new List<SelectListItem>(); | ||
authorList.Add(new SelectListItem { Text = "All", Selected = selAuthor == "All" }); | ||
var authors = Membership.GetAllUsers(); | ||
foreach (var author in authors) | ||
{ | ||
authorList.Add(new SelectListItem { Text = author.ToString(), Selected = author.ToString() == selAuthor }); | ||
} | ||
var orderList = new List<SelectListItem> | ||
{ | ||
new SelectListItem{ Text = "Latest", Value="Published", Selected = selOrder == "Published" }, | ||
new SelectListItem{ Text = "Most commented", Value="Comments", Selected = selOrder == "Comments" }, | ||
new SelectListItem{ Text = "Alphabetical", Value="Alphabetical", Selected = selOrder == "Alphabetical" } | ||
}; | ||
|
||
} | ||
<link rel="stylesheet" href="~/Content/bootstrap.min.css"> | ||
<link rel="stylesheet" href="~/admin/themes/standard/css/styles.css"> | ||
<style> | ||
body { background-color: #fff; } | ||
</style> | ||
<form method="post"> | ||
<div class="form-group"> | ||
<label for="txtNumberOfPosts">@Resources.labels.numberOfPosts</label> | ||
@Html.TextBox("txtNumberOfPosts", numberOfPosts, new { @class = "form-control" }) | ||
</div> | ||
<div class="form-group"> | ||
<label for="ddlCategories">@Resources.labels.category</label> | ||
@Html.DropDownList("ddlCategories", catList, new { @class = "form-control" }) | ||
</div> | ||
<div class="form-group"> | ||
<label for="ddlAuthors">@Resources.labels.author</label> | ||
@Html.DropDownList("ddlAuthors", authorList, new { @class = "form-control" }) | ||
</div> | ||
<div class="form-group"> | ||
<label for="ddlSortBy">@Resources.labels.sortOrder</label> | ||
@Html.DropDownList("ddlSortBy", orderList, new { @class = "form-control" }) | ||
</div> | ||
<div class="form-group"> | ||
<label> | ||
@Html.CheckBox("cbShowImg", showImg) Display first image as thumbnail | ||
</label> | ||
</div> | ||
<div class="form-group"> | ||
<label> | ||
@Html.CheckBox("cbShowDesc", showDesc) Display post description | ||
</label> | ||
</div> | ||
<div class="form-group"> | ||
<label> | ||
@Html.CheckBox("cbShowDate", showDate) Display date published | ||
</label> | ||
</div> | ||
<div> | ||
<button type="submit" class="btn btn-success btn-sm pull-left"> | ||
@Resources.labels.save | ||
</button> | ||
</div> | ||
</form> |
Oops, something went wrong.