我为所有这些类别创建了不同的页面:书籍、移动、计算等。 现在我想在所有页面中设置这种类型的导航菜单(如图所示),打开一个页面应该突出相应的菜单链接。
难道我应该建立一个包含文本和链接的体系,使它具有多重价值吗?所以我应该创建一个构件,最终在所有网页上都形成一个构件?
如果不愿意,请建议采取任何其他更好的办法。
""https://i.sstatic.net/jvCkM.gif" alt="在这里输入图像描述"/ >
我为所有这些类别创建了不同的页面:书籍、移动、计算等。 现在我想在所有页面中设置这种类型的导航菜单(如图所示),打开一个页面应该突出相应的菜单链接。
难道我应该建立一个包含文本和链接的体系,使它具有多重价值吗?所以我应该创建一个构件,最终在所有网页上都形成一个构件?
如果不愿意,请建议采取任何其他更好的办法。
""https://i.sstatic.net/jvCkM.gif" alt="在这里输入图像描述"/ >
如果您使用 ASPX 作为页面类型, 下面描述其他导航逻辑 :
创建一个包含重要页面信息( ID、 路径、 标题...) 的导航 xml( 包含所有页面)
创建将生成面包屑或任何其他导航的 ascx 控件。 作为参数控件, 参数控件应检索当前页面 ID
这样您就可以缩短时间( 出版), 导航将会在页面加载时完成 。 不幸的是, 您会以这种方式增加页面加载时间 。 这取决于您需要什么更合适的解决方案 。 更新导航 XML 是这个方法的问题之一 。
生成三重星中任何导航的最常用方式就是简单地在基于结构组和页面的 C# 模板中生成。
例如,在模板中(要么是C#碎片,要么是执行 Itemplate
的分类),很容易产生面包屑线索,其方式如下:
var pageDocument = package.GetByType(ContentType.Page).GetAsXmlDocument();
var current = new Page(pageDocument.DocumentElement, engine.GetSession());
var breadcrumb = page.Title;
while (current.OrganizationalItem != null)
{
current = current.OrganizationalItem;
breadcrumb = current.Title + " > " + breadcrumb;
}
package.PushItem("breadcrumb",
package.CreateStringItem(ContentType.Text, breadcrumb));
上述碎片实际上只显示如何向上浏览结构组的层次。 您仍然需要将每个结构组作为链接, 也许通过查看每个 < code> PublishUrl 属性的 < code> Structure Group code >, 来将每个结构组设置为链接 。
我知道你不是在问面包屑线索,你看起来更像左键。但所有导航元素的处理方法相似:用托姆.NET在您的外板上绕过相关的页面和结构组,并从中生成您的导航 HTML。
要获得当前结构组中所有页面的列表( 并标记当前结构组), 我希望有类似的东西 :
var pageDocument = package.GetByType(ContentType.Page).GetAsXmlDocument();
var current = new Page(pageDocument.DocumentElement, engine.GetSession());
var sg = (StructureGroup) page.OrganizationalItem;
string result = "<ul>";
foreach (var page in sg.GetItems())
{
result += (page.Id != current.Id) ? "<li>" : "<li class= selected >";
result += page.Title;
result += "</li>";
}
result += "</ul>";
package.PushItem("siblings", package.CreateHtmlItem(result));
也请参看
Is there any way of finding the absolute URL for a published object in the SDL Tridion Interface? For example when I published a page, how can I find the url where to access the page?
I have got below code in VBScript. Sub SetPageLocale() Dim Locale Dim ContextObject Set ContextObject=getContextObject Locale=getFieldValue(ContextObject.Publication.MetadataFields("...
我正在使用xslt 1.0,正试图将目前的日期和时间印在我的节点上。 样本Xslt如下:
Can you please suggest why I am getting below error, when I am trying to upload my Assembly using TCMUploadAssembly.exe, below is the setting which I have done in my POST Build event. $(ProjectDir)...
Brief Summary: We are using Tridion 2009 SP1, however we never used .NET templating, we are still using R5 concept i.e. (VBScript, XSLT etc), we are using broker database for our linking etc. Our ...
Problem Description: Publishing JSP pages work with the following for broker.config. <Publications DefaultRootLocation="/apps/tridion/wwwroot" DefaultRootDataLocation="/apps/...
Over the past 3 years I have been using (...shamefully) SharePoint 2007, DNN and Tridion to develop web portals. I am however looking to move off SharePoint and Tridion (lack of control over urls, ...
I am using XSLT1.0 for transforming my XML. I am having below Tabs.xml <?xml version="1.0"?> <tcm:ListItems xmlns:tcm="http://www.tridion.com/ContentManager/5.0" ID="tcm:481-87289-4" ...