Modx TinyMCE HTML 格式
我目前正在构建一个允许使用 Shadowbox 预览照片和视频的网站。我还使用 jQuery Tools Scrollable 工具来允许滚动缩略图。我使用 ModX 作为 CMS。
我希望编辑页面的人都能够使用 TinyMCE 作为编辑器,这对于照片来说没问题,但对于视频来说,我也想要每个视频的描述。我需要代码采用以下格式,因为视频的每个元素都需要包装在 div 中才能使可滚动项正常工作。
<div>
<a href="video_preview/stupid girl.flv"><img src="images/vid.gif" alt="video 1" title="Stupid Girl" /></a>
<h4>STUPID GIRL</h4>
<p>Garbage perform classic hit Stupid Girl</p>
</div>
<div>
<a href="video_preview/rehearsals.flv"><img src="images/rehearsals.jpg" alt="video 2" title="Rehearsals" /></a>
<h4>REHEARSALS</h4>
<p>Garbage back stage and at rehearsals</p>
</div>
这里有 2 个视频,我想允许输入任意数量的视频。目前我无法让 TinyMCE 生成这种格式的代码。我该如何去做这件事,或者我应该以不同的方式看待这个问题。目前,上面的代码部分包含在它自己的块中
I'm currently building a site that allows previewing photos and videos using Shadowbox. I'm also using the jQuery Tools Scrollable tool to allows the thumbnails to be scrolled. I'm using ModX as the CMS.
I want whoever edits the page to be able to use TinyMCE as the editor, this has been OK for the photos but for the videos I want a description for each video too. I need the code to be in the following format as each of the elements for a video need to be wrapped in a div for the scrollable to work properly.
<div>
<a href="video_preview/stupid girl.flv"><img src="images/vid.gif" alt="video 1" title="Stupid Girl" /></a>
<h4>STUPID GIRL</h4>
<p>Garbage perform classic hit Stupid Girl</p>
</div>
<div>
<a href="video_preview/rehearsals.flv"><img src="images/rehearsals.jpg" alt="video 2" title="Rehearsals" /></a>
<h4>REHEARSALS</h4>
<p>Garbage back stage and at rehearsals</p>
</div>
Here there are 2 videos put I want to allow any number of videos to be entered. At the moment I can't get TinyMCE to generate code in this format. How do I go about doing this or is there a different way I should be looking at this. At the moment the above code section is contained within it's own Chunk
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你以错误的方式处理这件事。
创建一个名为视频的新文件夹
视频中的文档不需要显示在菜单等中。为视频中的文档分配一个模板,在本例中
为“视频模板” 为该模板创建以下项目的模板变量:电影文件、标题、描述。
使用块中的 HTML,在本例中为“视频块”,即。
然后在一个块中使用 Ditto 来交互您的“视频”文件夹,并以上面的块作为模板,即。
让我知道这是否有意义,但在我看来,你当然应该以与此类似的方式来解决它。
这样,当用户想要添加新视频时,他们只需在视频文件夹中创建一个新文档并设置模板变量即可。
I think you are going about this in the wrong manner.
Create a new folder called Videos
The documents in Videos don't need to show in menu etc. Assign the documents in Videos a template in this case "videos-template"
Create template variables for that template for the following items: Movie-file, title, description.
Use the HTML you have there in a chunk, in this case "video-chunk" ie.
Then in a chunk use Ditto to interate through your "videos" folder with the above chunk as the template ie.
Let me know if that makes sense but in my mind you should certainly be tackling it in a manner similar to this.
This way when the user wants to add new videos they simply create a new document in the videos folder and set the template variables.