W.r.t定制atreal.richfile.preview文件在plone中,对于文件预览,有一个名为视图.pt,它包含一个TAL语句,该语句显示用于激活/更新、刷新和折叠操作菜单的控件:。完整的代码段:
<dl class="richfile portlet"
tal:condition="view/available"
tal:attributes="id view/plugin_id"
i18n:domain="atreal.richfile.preview">
<dt tal:attributes="id string:${view/plugin_id}Header" class="rfheader portletHeader">
<span class="portletTopLeft"></span>
<!--tal:block tal:replace="structure view/controls" -->
<span class="title" style="font-weight:bold"
i18n:translate="">
Preview
</span>
<span class="portletTopRight"> <span>
</dt>
<dd tal:content="structure view/getPreview" >
<!--Your specific code here-->
<IFRAME src="http://somesite.com"
tal:attributes="src string:${here/absolute_url}/rfpreview"
ondragstart="false" onselectstart="false"
width="100%" height="400" scrolling="auto" frameborder="0"> </IFRAME>
<!--End of specific code-->
</dd>
</dl>
如果删除<tal:block tal:replace="structure view/controls" >
,就可以正确地查看doc、xls、odt文件格式。但是对于pdf文件,所有的内容都是杂乱无章的。如果我保持上面的语句不变,当我单击操作控件“激活/更新”或“刷新”时,它会打开另一个窗口,并且可以正确查看,但它会下载doc xls和其他文件(由于超链接,这是不需要的)
另请注意,将默认的<dd>
属性更改为<dd tal:content="structure view/getPreview">
后,可以在没有背景图像的情况下查看pdf文件。你知道吗
如果语句保持原样,则会打开一个新窗口,其中有要缩放、打印和另存为的图标。我希望在此窗口中禁用这些。你知道吗
另外,我希望阻止从这个新窗口复制粘贴(我可以用viewlet中的javascript禁用复制粘贴),但它不会在新窗口中发生。我无法检测这个新窗口的模板。你知道吗
主要目的是防止从plone网站复制/粘贴/下载任何文件,但应允许文件预览。
有没有人能正确地指导ZMI中的确切位置以及如何定制它? 普隆4.1
解决此问题的另一种方法是定制模板,可从How to set TAL condition to check the file type and accordingly render the template in Plone 4.1获得
相关问题 更多 >
编程相关推荐