除了episerver.config之外还有其他地方你可以找到该网站建立的EPiServer的版本("EPiServer 6"/"EPiServer 6 R2")吗?
通常我会查看episerver.config并将这些数字与Deployment Center中的数字进行比较,以确定它是"EPiServer 6"还是"EPiServer 6 R2".
我只使用过EPiServer 6和EPiServer 6 R2,因此这些版本与问题最相关.
编辑:更新了两个第一段,我的意思是单词版本.
我在episerver树中遇到了复制/粘贴操作的问题.
当我尝试复制并粘贴页面时,运行后台作业,但是它失败并显示错误:
无法复制页面"主页"下方的"测试内容页面"页面.
你有遇到过这样的情况吗?这可能是权利问题吗?
我有一个自定义属性,我想根据用户权限进行不同的呈现..我的问题是我不知道如何获取登录用户的权限..并且如上所述我的"上下文"不在页面内,它在定制属性..
我如何获得当前用户的权限?
提前致谢!
Internet Explorer表示由于在运行基于Episerver的asp Web应用程序以及由于文本编辑器加载内容中相关的tinymce时长时间运行的脚本而没有响应,因此如何消除它。有时IE崩溃。位置是tinyMCE调用应用它的时间到文本区域。
function addTinyMCE(){
$('textarea').tinymce({
script_url:'tiny_mce.js',
theme:'advanced',
mode:'none',
});
}
var config={
autoOpen:true,
open:addTinyMCE //HERE IT TAKES THE NOT RESPONDING DUE TO A LONG RUNNING SCRIPT
}Run Code Online (Sandbox Code Playgroud)
因此需要解决此问题,因为我需要将编辑器用作tinyMCE
问候所有 EPiServer 专家。
环境:EPiServer 7。
问题描述:
我有一个具有不同属性的 PageType。其中一个属性是 ContentReference。
[CultureSpecific]
[Display(
Name = "Specific documents",
GroupName = SystemTabNames.Content,
Order = 1)]
public virtual ContentReference SpecificDocument { get; set; }
Run Code Online (Sandbox Code Playgroud)
在我看来,我显示一个链接到不同操作的图标,具体取决于属性 SpecificDocument 是否为空。ContentReference 属性应该包含一个文件,例如 PDF。
@model IPageViewModel<SpacePage>
<div class="row">
@if (Model.CurrentPage.SpecificDocument != null)
{
<a class="image" href="#"> </a>
}
else
{
<a class="icon" href="some action if the property is empty"></a>
}
</div>
Run Code Online (Sandbox Code Playgroud)
我的问题:
如果 SpecificDocument 属性不为 null,我如何href到ContentReference 属性中的特定内容?
说明:当用户单击该图标时,它会在窗口中打开特定文档 (PDF) 或下载它。
请记住,我是 EPiServer 开发的新手。
问候,克里斯
最近我为我们的一个站点实现了[ContentOutputCache],并且大部分都很棒.当管理员登录CMS时,缓存似乎停止工作.这可能是设计上的.是否有可能阻止这种情况发生?我希望缓存仅在发布内容时刷新.
我正在尝试动态地将DB中的值分配给继承自EpiServer PageData类的属性.这就是我的意思:
namespace Episerver9.Models.Pages
{
[ContentType]
public class StartPage : PageData
{
public virtual string Username { get; set; }
public virtual string Password { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
[ReadOnly(false)]
[Editable(true)]
public virtual string testfield { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
在控制器中我正在尝试以下方法:
namespace Episerver9.Controllers
{
public class StartPageController : PageController<StartPage>
{
// GET: StartPage
public ActionResult Index(StartPage currentPage)
{
currentPage.testfield = "test";
return View(currentPage);
} …Run Code Online (Sandbox Code Playgroud) 我找到了一些关于如何向页面添加块的建议,但无法按照我想要的方式工作,所以也许有人可以提供帮助。
我想要做的是安排一个读取文件的计划作业,创建具有特定页面类型的新页面,并在新页面中向内容属性添加一些块。块字段将使用读取的文件中的数据进行更新。
我在预定的作业中有以下代码,但它失败了
repo.Save((IContent) newBlock, SaveAction.Publish);
Run Code Online (Sandbox Code Playgroud)
给出错误
页面名称必须至少包含一个可见字符。
这是我的代码:
public override string Execute()
{
//Call OnStatusChanged to periodically notify progress of job for manually started jobs
OnStatusChanged(String.Format("Starting execution of {0}", this.GetType()));
//Create Person page
PageReference parent = PageReference.StartPage;
//IContentRepository contentRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();
//IContentTypeRepository contentTypeRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentTypeRepository>();
//var repository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();
//var slaegtPage = repository.GetDefault<SlaegtPage>(ContentReference.StartPage);
IContentRepository contentRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentRepository>();
IContentTypeRepository contentTypeRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance<IContentTypeRepository>();
SlaegtPage slaegtPage = contentRepository.GetDefault<SlaegtPage>(parent, contentTypeRepository.Load("SlaegtPage").ID);
if (slaegtPage.MainContentArea == null) {
slaegtPage.MainContentArea = new ContentArea();
}
slaegtPage.PageName = "001 …Run Code Online (Sandbox Code Playgroud) 所以我想创建我的第一个块.这个块的想法是从api端点获取最新消息,然后在网站的不同页面上显示.
我所理解的是这个
创建一个块类型,类似这样
public class NewsBlock : BlockData
{
[CultureSpecific]
[Display(
Name = "Heading",
Description = "Add a heading.",
GroupName = SystemTabNames.Content,
Order = 1)]
public virtual String Heading { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
然后我为我的Block创建了一个模型
public class LatestNewsViewModel
{
public NewsBlock NewsBlock { get; private set; }
public IEnumerable<dynamic> LatestNews { get; set; }
public LatestNewsViewModel(NewsBlock latestNewsBlock, IEnumerable<dynamic> latestNews)
{
NewsBlock = latestNewsBlock;
LatestNews = latestNews;
}
}
Run Code Online (Sandbox Code Playgroud)
然后我创建一个块控制器并在索引操作中从我的api获取数据并填充块容器数据然后我创建一个局部视图然后从控制器传递数据到视图然后从仪表板我可以添加我的块我在哪里想在网站上
这是这样做的吗?或者我错过了什么?
我有一个以 ContentArea 作为其属性之一的页面类型
(currentPage.PrimaryComponentArea)
如何根据其类型获取存储在此属性中的块项目。
我还想访问块上的属性,所以我需要将它从 ContentAreaItem 转换为实际的块类型。
public ActionResult Index(RatePlanPageType currentPage)
{
..........
var allItems = currentPage.PrimaryComponentArea.Items;
var blocks = allItems.Where(x => bla bla bla < Can I do it using linq
}
Run Code Online (Sandbox Code Playgroud)
这是我的第一个 Episerver 项目,所以我希望这不是一个愚蠢的问题。
episerver ×10
c# ×3
asp.net ×2
asp.net-mvc ×1
block ×1
caching ×1
episerver-6 ×1
episerver-9 ×1
href ×1
properties ×1
readonly ×1
tinymce ×1