Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
repeat output of content x times
hi and thanks for stopping by.
i have a lil php problem i guess. i know, i could do this via javascript, but i want the server to do it..
i put out a variable that calculates the amount of images.
now i want, that each image gets its own radio button..
im using upm_image
and aks_var
to calculate the amount.
<txp:upm_article_image>
<img src="<txp:upm_img_full_url />" id="i<txp:article_id />_<txp:aks_evar name="<txp:article_id />_img_id" calc="+1" />" />
</txp:upm_article_image>
<txp:aks_evar name="<txp:article_id />_img_id" />
so if my article has 4 images, the variable img_id puts out the correct amount of 4.
so what do i have to do, to repeat the output of xy with a given index..
php make stuff like: for index=1; index < variable; index++ {
<input id="b<txp:article_id />_index" name="blablubb_<txp:article_id />" type="radio" />
}
…? any help on this is appreciated (:
Offline
Re: repeat output of content x times
So the radio buttons are somewhere else on the page? Why not just go through article_image again?
<txp:images><!--in an article context this will iterate through the article_image field-->
<input id="b<txp:article_id />_<txp:image_info type="id" />" name="blablubb_<txp:article_id />" type="radio" />
</txp:images>
note: using images tag here just because I’m not familiar with upm_article_image.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: repeat output of content x times
right n exact.
just repeat the upm_img output without the images..
thanks for the hint!
Offline
Pages: 1