添加 Flash 视频

发布于 2024-09-25 15:39:40 字数 251 浏览 0 评论 0 原文

几天来我一直在试图解决这个问题。希望有人能帮忙。

我正在为一个网站实施一个新主题。我将 html 添加到 page.tpl.php 文件中,并使用适当的变量填充它,到目前为止它工作正常。

它由页眉、页脚以及左右 div 组成。左侧 div 成功显示 $content 变量的输出。

右侧的 div 应该显示一个 Flash 视频,后跟两个图像,所有图像都是垂直显示的,每个页面都有所不同。我真的被困住了。

我该如何添加这些?

I have been trying to figure this out for days. Hope someone can help.

I am implementing a new theme for a site. I added the html to a page.tpl.php file, populated it with the appropriate variables, and it works OK so far.

It consists of a header, footer, and a left and right div. The left div successfully displays the output of the $content variable.

The right div is supposed to show a flash video followed by two images, all displayed vertically, which vary with each page. And here I'm really stuck.

How do I go about adding these?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

温柔戏命师 2024-10-02 15:39:40

根据您想要编程的程度,您可能会使用块。我不想编程太多,用你想要的每个图像/视频组合创建一堆块。如果您不介意编程,您可以在模块中创建一个块,其中包含在正确页面上提取正确图像/视频所需的所有代码。

但最基本的方法是在 /admin/build/block/add 中,然后将该块与 /admin/build/block 上的正确区域关联起来。您可以控制这些块在块编辑表单上显示的页面。

此链接可能对您有用。

Depending on how much you want to program you're probably going to use blocks. I you don't want to program a lot create a bunch of blocks with each image/video combo you want. If you don't mind programming you can create a block in a module with all the code necessary to pull up the right images/videos on the right page.

But the most basic way will be at /admin/build/block/add then associate the block with the right area on /admin/build/block. You can control which pages these blocks wind up on on the block edit form.

This link may be handy for you.

夜雨飘雪 2024-10-02 15:39:40

您需要做的第一件事是将文件添加到每个页面。您可以使用 CCK文件字段

将文件放入页面后,您需要将它们从 $content 中取出,默认情况下它们会显示在此处。您可以通过在 CCK 中的“显示字段”下关闭这些字段来完成此操作。

现在这些文件不再位于 $content 中,您需要将其放在其他位置。大多数主题都有一个 $right 区域,您可以使用它。所以把 $right 放在你的右边 div 中。您可以使用块填充 $sidebar,因此您需要一个包含给定页面的文件的块。

您可以使用视图来实现此目的。创建一个新的节点视图,添加节点 ID 参数,并从 URL 为其指定默认值。这基本上告诉视图查看当前节点/页面。在“字段”下,选择“内容”并找到您使用 CCK 添加的文件字段。最后,添加“块”类型的显示。节省。

现在您在当前页面上有一个包含文件的块,并且每个页面上都有 $right 区域,因此只需转到块管理页面并将此块放入该区域即可。

The first thing you need to do is add the files to each page. You can do that with CCK and filefield.

Once you have the files in the pages, you need to get them out of $content, where they'll show up by default. You can do this by turning the fields off under Display Fields in CCK.

Now that the files are no longer in $content, you need to put it in something else. Most themes have a $right region you can use for that. So put $right in your right div. You can populate $sidebar with blocks, so you need a block containing the files for the given page.

You can make this with Views. Create a new node view, add an argument for node ID, and give it a default value from the URL. This basically tells the view to look at the current node/page. Under Fields, choose "Content" and find the file fields you added with CCK. Finally, add a display of type "Block." Save.

Now you have a block with the files on the current page, and you have the $right region on every page, so just go to the Blocks admin page and put this block in that region.

¢蛋碎的人ぎ生 2024-10-02 15:39:40

斯科特和查克已经提供了这个问题的详细信息,但我想我只想指出每个答案可能合适的场景。

如果您希望这些视频和照片块显示在不是节点页面的页面上,那么您可能需要采用类似于 Chuck 提供的答案的解决方案。

最有可能的是,听起来您确实希望视频和照片与左侧显示的内容相关。如果是这样的话,那么斯科特告诉你你需要知道的事情。

Scott and Chuck have already provided the details for this question, but I thought I would just point out scenarios when each answer may be appropriate.

If you want those video and photo blocks to display on pages which are NOT node pages, then you will probably need to go with a solution similar to the answer Chuck provided.

Most likely, it sounds like you do want the the video and photos to be related to the content shown on the left. If that is the case, then Scott told you what you need to know.

渔村楼浪 2024-10-02 15:39:40

上述建议的最后一条如下:

  1. “我如何(在哪里)设置它,以便视图识别出它位于节点 3 上并仅显示节点 3 的图像。” -- 您可以通过单击视图中 Nid 参数的设置来完成此操作。在参数不存在时要采取的操作下:选择提供默认参数。其中,从 URL 中选择节点 ID
  2. 将您的块放置在适当的区域(左侧边栏、右侧边栏等)。确保块的可见性设置使其仅出现在与节点/*匹配的路径上,

谢谢大家!

One final piece to the advice from those above was the following:

  1. "How (where) do I set it up so that the view recognizes that it is on Node 3 and displays only the images for Node 3." -- you can do this by clicking on the settings for the Nid argument in Views. Under Action to take if argument is not present: choose Provide Default Argument. In that, choose Node ID from URL
  2. Position your block in the appropriate region (left sidebar, right sidebar etc). Make sure the visibility settings of the block are such that it only appears at paths that match node/*

Thanks, all!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文