问候所有 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 开发的新手。
问候,克里斯
我必须打开一个电子邮件窗口,在其中我需要在正文中提供一个超链接和一个 onClick 事件。
这是我的代码。
ClickEmail : function (){
var Subject = "Test";
var body = "";
body = body + " Name1 " + record.name[0] + "%0D%0A";
MyRecord == window.location.href = 'mailto:?subject=Subject :'+Subject+'&body=My Body'+body
}
Run Code Online (Sandbox Code Playgroud)
谁能解释一下我需要做什么。
我在这里看到了类似的问题并实施了解决方案,但似乎仍然无法解决这个问题。还是一个 R 新手,所以请耐心等待:我已经设法使用 rvest从该网站获取了巴拉克·奥巴马 (Barack Obama) 的演讲表:
library(rvest)
page <- read_html("http://www.americanrhetoric.com/barackobamaspeeches.htm")
speeches <- page %>%
html_nodes(xpath = '//*[@id="AutoNumber1"]') %>%
html_table(fill=TRUE)
speeches <- speeches[[1]][,2:4]
head(speeches)
Run Code Online (Sandbox Code Playgroud)
产生:
X2 X3 X4
1 <NA> <NA> <NA>
2 Delivery Date Speech Title/Text/MultiMedia Audio
3 27 July 2004 Democratic National Convention Keynote Speech mp3
4 06 January 2005 Senate Speech on Ohio Electoral Vote Counting mp3
5 04 June 2005 Knox College Commencement Speech mp3
6 15 December 2005 Senate Speech on the PATRIOT Act …Run Code Online (Sandbox Code Playgroud) 我是 HTML 世界的新手。
我在服务器上创建了一个“example.html”网页,
其中包含以下标签链接。
...
<nav>
<ol>
<li><a href="http://localhost/link1.html">link1</a></li>
<li><a href="http://localhost/link2.html">link2</a></li>
<li><a href="http://localhost/link3.html">link3</a></li>
</ol>
</nav>
...
Run Code Online (Sandbox Code Playgroud)
如果我"http://localhost/example.html"在服务器的 Web 浏览器上打开此页面并单击链接(link1~link3),它们就会工作。
问题是它们在客户端的 Web 浏览器上不起作用。
我端口转发我的服务器计算机并"example.html"从客户端打开,
通过"http://myaddress.com:1234/example.html"
暂时,我通过将
服务器代码中的每个链接 更改"http://localhost/~~~.html"
为"http://myaddress.com:1234/~~~.html".
但是,我想让客户端访问服务器代码中的每个链接,如下所示 "http://localhost/~~~.html"
是端口转发的问题吗?或者是其他东西?
非常感谢。
我有一些看起来像这样的东西:
<ContentBlock
className={'text-gray-300 mt-4'}
>
Blah blah blah, blah BLAH, blah
<a href="foo.bar"
className={'underline text-gray-200 hover:text-blue-300'}>
foo bar
</a>
</ContentBlock>
Run Code Online (Sandbox Code Playgroud)
显示时,href 链接始终单独换行。我怎样才能使它保持“附加”到前面的文本?
在我看来,我给出的URL是这样的:
<td style="border-bottom: solid 1px #f3ad44" align="center">
<a class="actions" href="<%= item.URL %>">www...</a>
</td>
Run Code Online (Sandbox Code Playgroud)
我的问题是item.URL有一个类似的值:www.hello.com但当我从网页点击它导航到http://localhost:64075/www.hello.com.
如何避免使用localhost,并实际导航到http://www.hello.com?
在#page2上,我有一个由openContent()函数触发的隐藏内容.
在#page1上,我想要一个href标签加载#page2然后加载openContent()函数.
我试图创建一个onClick事件,它将在#page1上同时执行,但它不起作用.
我是jQuery的新手,我必须把它搞砸了.
谢谢
使用jQuery,我试图<a href="/folder/whatever.file">link</a>在页面上找到任何实例并将http://www.domain.com放在/ folder之前.
最简单,最安全的方法是什么?
我有一些数据需要在没有网站预定义样式的情况下发布,以防止表单受阻.我可以使用href在不使用表单的情况下发布数据,然后使用PHP检索它吗?
HTML示例:
<a href="rcon.php?action=roomForward&roomId=7" />
Run Code Online (Sandbox Code Playgroud)
PHP示例:
<?php
[Function Stuff for roomForward Here..]
$core->Mus('senduser', '$_GET["roomid"]', ' . USER_ID . ');
?>
Run Code Online (Sandbox Code Playgroud)
我的代码并不完美,但它现在应该是有意义的!
在我的网络应用程序中,许多功能作为链接暴露为具有暴露该功能的onclick处理程序,但实际链接设置为javascript void(0),如此...
<a href="javascript:void(0)" onclick="myApp.callJen(1303, this)" rel="nofollow">Call Jennifer</a>
Run Code Online (Sandbox Code Playgroud)
当我的应用程序注入Backbone.js和Angular等单页应用程序(SPA)时,这些链接看起来并不好用.有时在这些站点中单击此链接将转到未找到的实际页面(不确定为什么会发生这种情况).
无论如何我应该如何替换这些网站的链接?
我们现在说使用真实的URL或按钮不是一个选项.
其他帖子建议这样的东西..
<a href="#!">Link</a>
Run Code Online (Sandbox Code Playgroud)
或者这 ......
// Cancel click event
$('.cancel-action').click(function(){
alert('Cancel action occurs!');
});
a { cursor: pointer; color: blue; }
a:hover,a.hover { text-decoration: underline; }
<a class="cancel-action">Cancel this action</a>
Run Code Online (Sandbox Code Playgroud)
老实说,我不喜欢其中任何一种,所以你能提出更好的建议吗?
href ×10
html ×5
javascript ×3
jquery ×2
asp.net-mvc ×1
backbone.js ×1
c# ×1
css ×1
episerver ×1
get ×1
localhost ×1
onclick ×1
optimization ×1
php ×1
r ×1
replace ×1
rvest ×1
url ×1
web ×1
web-scraping ×1