Drupal 6:每个页面都有不同的幻灯片,最终用户可以轻松进行节点内编辑

发布于 2024-11-26 03:26:36 字数 196 浏览 1 评论 0原文

Drupal 6 的新手。我看到有很多幻灯片模块,但似乎大多数都需要相当多的配置,并且用户以后更改会很麻烦。我的一些页面有滑块,而另一些页面在同一位置有单个图像。我不想为每个滑块都有一个单独的节点。客户无法处理这个问题。我希望通过页面本身的附件部分以及图像标题和替代文本字段上传图像。然后我想将其与标题和替代文本一起显示为幻灯片,并带有切换到上一个和下一个的按钮。可以这样做吗?

new to Drupal 6. I see a lot of slideshow modules out there, but it seems like most of them require quite a lot of configuration, and would be cumbersome for the user to change later. Some of my pages have sliders, and others have single images in the same spot. I don't want to have a separate node for each slider. The client can't handle that. I would like to have the images uploaded via the attachment section in the page itself, and fields for the image title and alt text. Then I would want to take that and display the image along with the title and alt text as a slideshow, with buttons to switch to previous and next. Is it possible to do this?

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

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

发布评论

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

评论(1

寒尘 2024-12-03 03:26:36

jquery 幻灯片模块几乎可以完成您想要的操作,但它没有下一个/上一个按钮。

我建议只找到您想要使用的 javascript 幻灯片产品,然后手动将其集成到节点模板中。

最近,我将 jqFancyTransitions 集成到了 Drupal 6 项目中。内容类型包含一个图像字段,设置为允许多个值。

我在主题中安装了该库,然后在内容类型特定的节点模板中添加了以下内容:

mycontenttype-node.tpl

<script src="/sites/all/themes/mytheme/jqFancyTransitions.1.8.min.js" type="text/javascript"></script>
<div id='ft'>
  <?php foreach ($node->field_my_photo_field as $image): ?>
    <img src="/sites/default/files/imagecache/my_photo_imagecache_preset/<?php print base_path() . str_replace(' ', '%20', $image['filepath']); ?>" alt="" />
  <?php endforeach; ?>
</div>
<script>
$('#ft').jqFancyTransitions({ width: 350, height: 300, navigation: true, effect: 'wave' });
</script>

注意,我使用图像缓存预设来裁剪和裁剪将图像缩放到 350x300,我必须 str_preplace 空格,因为 jqfancytransitions 不喜欢它们。这只是因为它是比要求用户不使用空格或修改文件名更简单的解决方案。

The jquery slideshow module almost does what you want, but it doesn't have the next/previous buttons.

I'd recommend just finding a javascript slideshow product that you want to use, and then manually integrate it into a node template.

Recently, I integrated jqFancyTransitions into a Drupal 6 project. The content type contains a image field, set to allow multiple values.

I installed the library in my theme, then, in the content type specific node template, I added this:

mycontenttype-node.tpl

<script src="/sites/all/themes/mytheme/jqFancyTransitions.1.8.min.js" type="text/javascript"></script>
<div id='ft'>
  <?php foreach ($node->field_my_photo_field as $image): ?>
    <img src="/sites/default/files/imagecache/my_photo_imagecache_preset/<?php print base_path() . str_replace(' ', '%20', $image['filepath']); ?>" alt="" />
  <?php endforeach; ?>
</div>
<script>
$('#ft').jqFancyTransitions({ width: 350, height: 300, navigation: true, effect: 'wave' });
</script>

Note, I'm using an imagecache preset to crop & scale the images to 350x300, and I had to str_preplace spaces because jqfancytransitions didn't like them. That's only because it was an easier solution than either requiring users not to use spaces or modifying their file names.

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