Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-04-04 16:51:44

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

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

#2 2011-04-04 20:45:37

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2011-04-05 08:26:15

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: repeat output of content x times

right n exact.
just repeat the upm_img output without the images..

thanks for the hint!

Offline

Board footer

Powered by FluxBB