방금 RTF 필드에 콘텐츠를 추가한다면 맞춤 URL을 사용하는 것이 훨씬 적지 않으시겠습니까?
사용자 정의 URL은 해당 필드의 제목에 대한 링크로 구성 요소에 표시되는 스키마 필드에서 설정할 수있는 링크입니다. 이렇게하면 지정한 URL로 팝업이 열리고 여기에서 직접 필드로 돌아와서 (기존 내용에 추가하거나 기존 내용을 바꿀 수 있습니다).
<html>
<head>
<title>Custom URL example</title>
<style>
body {
background:#fafafa;
font-family:arial,helvetica,sans-serif;
font-size:12px;
line-height:1.5em;
}
a {
color:#000;
font-weight:bold;
text-decoration:none;
}
a:hover {
color:#666;
}
</style>
<script type="text/javascript" language="javascript" src="/WebUI/Core/Controls/Popup/PopupInit.js"></script>
<script language="JavaScript">
function overwrite(value) {
var fields = window.dialogArguments.getFields();
if (fields && fields.length > 0) {
if (fields[0].getValues() != null && fields[0].getValues()[0] != null && fields[0].getValues()[0].length > 0) {
if (!confirm('This will overwrite the existing content of the field. Continue?')) {
return;
}
}
fields[0].setValues([value]);
window.close();
}
}
function append(value) {
var fields = window.dialogArguments.getFields();
if (fields && fields.length > 0) {
var current = '';
if (fields[0].getValues() != null && fields[0].getValues()[0] != null && fields[0].getValues()[0].length > 0) {
current = fields[0].getValues()[0];
}
fields[0].setValues([current + value]);
window.close();
}
}
</script>
</head>
<body>
<h1>Make a choise</h1>
<p><a href="javascript:overwrite(' - dummy content - ')">overwrite current value</a></p>
<p><a href="javascript:append(' - dummy content - ')">append to current value</a></p>
</body>
</html>
이는 다음과 같습니다
이 주제에 대한 문서는 http://docportal.sdl.com/sdltridion (direct topic link)
다음과 같이 보일 것입니다 텍스트 필드에 내용을 덮어 쓰거나 추가의 예 사용자 정의 URL HTML 페이지에서 확인할 수 있습니다 .. \ Tridion \ web 폴더에 배치해야하는 HTML 페이지 (일반적으로 CustomURL 하위 디렉토리를 작성하므로 /CustomUrl/example.html과 같이 참조 할 수 있습니다.)
응답 해 주셔서 감사합니다. 맞춤 URL을 사용하여 콘텐츠를 대체하는 방법을 설명해 주시겠습니까? –
에는 append 및 overwrite 옵션이있는 사용자 정의 url html 페이지의 예제가 추가되었습니다. –