ModX getResources模板块HTML乱序?(ModX getResources template chunk HTML out of order?)

编程入门 行业动态 更新时间:2024-10-28 07:20:07
ModX getResources模板块HTML乱序?(ModX getResources template chunk HTML out of order?)

我有一个getResources块,看起来像:

<a href="[[+tv.galimage]]" class="fancybox galitem" title="[[+pagetitle]]"> <div class="galimage" style="background-image: url('[[+tv.galimage]]')"></div> </a>

但由于某种原因,前两个资源出现在A标签之外的div,例如:

<a href="images/Gallery/ferrari1.jpg" class="fancybox galitem" title="Image 2"> </a> <div class="galimage" style="background-image: url('images/Gallery/ferrari1.jpg')"></div>

然而,在前两个和使用相同模板块之后的所有其他资源都按预期显示,例如:

<a href="images/Gallery/porsche.jpg" class="fancybox galitem" title="Image 2"> <div class="galimage" style="background-image: url('images/Gallery/porsche.jpg')"></div> </a>

有谁知道为什么会发生这种情况以及我能做些什么来解决它?

(显然,我已经尝试清除缓存。此外,这似乎并未与特定资源隔离。无论哪个资源首先出现在列表中,都会发生这种情况。)

I have a getResources chunk that looks like:

<a href="[[+tv.galimage]]" class="fancybox galitem" title="[[+pagetitle]]"> <div class="galimage" style="background-image: url('[[+tv.galimage]]')"></div> </a>

but for some reason the first two resources appear with the div outside of the A tags, eg:

<a href="images/Gallery/ferrari1.jpg" class="fancybox galitem" title="Image 2"> </a> <div class="galimage" style="background-image: url('images/Gallery/ferrari1.jpg')"></div>

Yet every other resource following these first 2 and using the same template chunk appears as expected, eg:

<a href="images/Gallery/porsche.jpg" class="fancybox galitem" title="Image 2"> <div class="galimage" style="background-image: url('images/Gallery/porsche.jpg')"></div> </a>

Would anyone know why this is occurring and what I could do to fix it?

(Obviously, I have tried clearing the cache. Also, this does not appear to be isolated to a particular resource. It occurs no matter which resources appear first in the list.)

最满意答案

将块元素( div )包装div联标记中是一个奇怪的问题。 把div改为span ,没关系。

It was a weird issue with wrapping a block element (div) in an inline a tag. Changed div to span and it was ok.

更多推荐

a>,<a,资源,div>,电脑培训,计算机培训,IT培训"/> <meta name="descri

本文发布于:2023-04-27 11:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1327103.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模板   getResources   ModX   HTML   order

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!