使用 html 页面作为 Umbraco 7 中没有树的自定义部分 [英] Use a html page as a custom section in Umbraco 7 without a tree
问题描述
我想在 Umbraco 7 的自定义部分中显示一个 HTML 页面.
I have a HTML page that I want to show in a custom section in Umbraco 7.
我想在该部分中没有任何树的情况下执行此操作,因为所有内容都已在 html 文件中处理 - 它被放入 Umbraco 后端以方便访问.
I want to do this without having any tree within that section, as everything is already handled within the html file - It is being placed into the Umbraco back end for convenient access.
到目前为止,我已经实现了 IApplication,它使该部分按预期显示.我确实有一个带有单个节点的树(从 BaseTree 继承,使其成为遗留部分),但是,我想充分利用可用空间,只需加载我的 html 文件,并且不显示树.
So far I have implemented IApplication which gets the section to show as expected. I did have a tree with a single node (Inheriting from BaseTree, making this a legacy section), however, I want to make full use of the space available and just load in my html file and have no tree showing.
从 BaseTree Render 方法中移除节点会隐藏显示树的面板,但我不知道如何加载 Html 文件作为该部分的默认视图.
Removing the nodes from the BaseTree Render method hides the panel that shows the tree, but I can't figure out how to load in the Html file as the default view for that section.
是否有一种简单的方法可以通过设置一个默认页面在用户点击进入该部分时加载?
Is there an easy way to do this by essentially setting a default page to load when the user clicks into the section?
推荐答案
您可以通过向 Dashboard.config 添加新的部分元素来设置 Umbraco 7 中自定义部分的默认视图,如下所示:
You can set the default view for a custom section in Umbraco 7 by adding a new section element to Dashboard.config as follows:
<section alias="StartupCustomDashboardSection">
<areas>
<area>custom</area>
</areas>
<tab caption="Get Started">
<control>/app_plugins/custom/defaultview.html</control>
</tab>
</section>
其中 元素必须包含自定义部分的别名,全部为小写.
where the <area>
element must contain the alias of your custom section, all in lower case.
元素包含默认 html 文件的路径.
The <control>
element contains the path of the default html file.
这篇关于使用 html 页面作为 Umbraco 7 中没有树的自定义部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!