Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Do I use <txp:yield> correctly?
On this page I’m using a slider. It does work … for a bit. But it doesn’t jump from image 5 to 1 or from 1 to 5. And I’m guessing it’s because I don’t use the <txp:yield> tag correctly.
Form (slider):
<div class="flexslider">
<txp:images id='<txp:yield name="id" />' wraptag="ul" break="li" class="slides">
<img loading="lazy" src='<txp:smd_thumbnail type="800"><txp:smd_thumbnail_info item="url" /></txp:smd_thumbnail>' alt='<txp:smd_thumbnail_info item="alt" />' srcset="<txp:smd_thumbnail type="400"><txp:smd_thumbnail_info item="url" /> 400w</txp:smd_thumbnail>, <txp:smd_thumbnail type="800"><txp:smd_thumbnail_info item="url" /> 800w</txp:smd_thumbnail>, <txp:smd_thumbnail type="1200"><txp:smd_thumbnail_info item="url" /> 1200w</txp:smd_thumbnail>, <txp:smd_thumbnail type="1600"><txp:smd_thumbnail_info item="url" /> 1600w</txp:smd_thumbnail>" sizes="(max-width: 640px) calc(100vw - 30px), (max-width: 1024px) 52.33vw, (max-width: 1440px) 50.33vw, 708px"/>
</txp:images>
</div>
[edit]
I saw image 5 didn’t have the correct smd_thumbnail(s). Now it has and the slider is working fine … :)
In article:
<txp::slider id="137, 135, 139, 31, 110" />
Am I right?
Last edited by RedFox (2019-11-27 11:45:21)
Offline
Re: Do I use <txp:yield> correctly?
It looks like you’ve used it just right to me.
On your page it does jump from 5 to 1 or from 1 to 5 but your last image is lacking a src / srcset and that may be the problem you’re seeing. The page source just shows a load of commas and spaces.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Do I use <txp:yield> correctly?
Yes, that’s correct. I saw image 5 didn’t have the right smd_thumbnails. Now it has and the slider works fine … :)
Last edited by RedFox (2019-11-27 14:16:07)
Offline
Pages: 1