表达式引擎:Fancybox +电子工程?
我在使用带有表达式引擎的 fancybox 时遇到问题。
基本上我使用矩阵插件设置了不同的画廊。每个画廊大约有 10 张图片。基本上我希望缩略图打开 fancybox 和 fancybox 以便能够滚动该矩阵条目/图库中的图像。
听起来很简单,但我似乎无法让 fancybox 滚动图像,它只是停留在第一张图像上。
这是我的缩略图代码:
<ul id="image_gallery">
{exp:channel:entries channel="gallery_images"}
<li>
<a class="grouped_elements" href="{title_permalink='gallery/view'}" rel="{title}">
{gallery_image limit="1"}
{exp:imgsizer:size src="{image}" width="200px" height="180px"}
<img src="{sized}" width="{width}" height="{height}" alt="" />
{/exp:imgsizer:size}
{/gallery_image}
</a>
<h1>{title}</h1>
</li>
{/exp:channel:entries}
</ul>
这是我的 fancybox 模板代码:
{exp:channel:entries channel="gallery_images"}
<ul id="img_gallery">
{gallery_image}
<li>
{exp:imgsizer:size src="{image}" width="650px" height="500px"}
<img src="{sized}" width="{width}" height="{height}" alt=""/>
{/exp:imgsizer:size}
</li>
{/gallery_image}
</ul>{/exp:channel:entries}
除了图像滚动之外,一切正常。
我将不胜感激任何帮助!
I am having a problem using fancybox with expression engine.
Basically I have different galleries set-up using matrix plugin. Each gallery has around 10 images. Basically I want the thumbnail to open up fancybox and fancybox to be able to scroll through the images in that matrix entry/gallery.
Sounds simple but I can’t seem to get fancybox to scroll through the images, it just stays on the first image.
This is my code for the thumbnails:
<ul id="image_gallery">
{exp:channel:entries channel="gallery_images"}
<li>
<a class="grouped_elements" href="{title_permalink='gallery/view'}" rel="{title}">
{gallery_image limit="1"}
{exp:imgsizer:size src="{image}" width="200px" height="180px"}
<img src="{sized}" width="{width}" height="{height}" alt="" />
{/exp:imgsizer:size}
{/gallery_image}
</a>
<h1>{title}</h1>
</li>
{/exp:channel:entries}
</ul>
This is my code for the fancybox template:
{exp:channel:entries channel="gallery_images"}
<ul id="img_gallery">
{gallery_image}
<li>
{exp:imgsizer:size src="{image}" width="650px" height="500px"}
<img src="{sized}" width="{width}" height="{height}" alt=""/>
{/exp:imgsizer:size}
</li>
{/gallery_image}
</ul>{/exp:channel:entries}
Everything works fine except for the image scrolling.
I’d appreciate any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有看到 ExpressionEngine 标记的输出,就很难理解问题出在哪里。但是,您的问题可能很简单,只需确保图库中的所有图像共享相同的HTML 关系属性。
相同
rel=""
属性的元素创建的:Fancybox 画廊是由共享 在您的代码中,您使用 ExpressionEngine
{title}
标记作为rel=""
属性。由于频道条目的标题可能包含空格和其他特殊字符,因此更好的选择是使用 URL 标题字段,
{title_permalink}
。{title_permalink}
标签使用连字符或下划线作为字符分隔符(使用URL 标题的单词分隔符)将频道条目标题转换为URL 安全 全局频道偏好设置中的strong>设置)。您更新的缩略图代码将是:
如果这不起作用,也许您可以提供更完整的代码示例,例如 jsFiddle 或 Pastie 来帮助我们了解问题可能出在哪里。
Without seeing the output of your ExpressionEngine tags, it's difficult to understand where the problem is. However, your problem may be as simple as making sure all of the images in a gallery share the same HTML relationship attribute.
Fancybox Galleries are created from elements who share the same
rel=""
attribute:In looking over your code, you're using the ExpressionEngine
{title}
tag as therel=""
attribute.Since the title of your channel entry likely contains spaces and other special characters, a better choice would be to use the URL Title field,
{title_permalink}
.The
{title_permalink}
tag converts the channel entry title to be URL-safe using either hyphens or underscores as character separators (using the Word Separator for URL Titles setting in the Global Channel Preferences).Your updated thumbnail code would then be:
If this doesn't work, perhaps you can provide a more complete code sample such as a jsFiddle or Pastie to help us understand where the problem may be.