A website has 4 web pages with one image in the center of each of them.With every refresh on the page the image should change.Only 5 images should be there at the max .This means at most there can be 5 changes of images for each page ,per refresh.I have to create a system where for all the 4 pages -I have to use " only one " DCT and PT and take entries for 4 different webpages in the same DCT whose DCR will call only one PT.The entries are images.5 different images for each web page. How should I proceed?
I don't think this is a TS issue - it's more of a web page design issue - I believe this is most often done with JavaScript, though it's possible other technologies (like Flash) might work for this too.From a TS perspective you just need to make sure the code in the (presumably generated) page is correct and that you have the images and that you deploy all of them to the correct locations on the web server.
This has to be done using Forms publisher !!! Thats the requirement
ghoti, i dont think any one over here has taken oath to learn interwoven by birth. however if you are so much experienced (over 9500 posts) dont expect too much from learners.
We have implemented something very similar, visit www.shell.com on the home page itself you will have shell image changing with every new session.You need to have a DCT with place holder for 5 images.In your tpl then you have to put javascript code which would first load all the images in one go and then on every iteration change the image.Let me know if anything is not clear here.
The problem is not only limited to making the images rotate.When the user is filling up dct he has to have options like 1)whether the image is an image or text or a flash file2)if its an image it has to have an alt attribute.3) whether it is clickable- needs a hyperlink4) for image -use img tag, for swf - use object tag.How I have planned to do the things is :Will use a replicant for the above options. The replicant can be iterated to a max of 5 times.With each iteration. a javascript function will be called to append the record to an array. This function ,with the help of array, create a javascript code (for randomising )that will get embeded in the asp page generated. I guess this should work!
I think you are asking more of web development that TS development. Out of the said issues, first 4 should be handled using formAPI and regex. However, i could not understood as why you are adding a record in array on each iteration? What if the user iterates and then changed the value of an earlier record? My suggestion would be to update the array 'OnSave'.I hope it clears up most of your doubts.
I donot understand how I can index all the replicated containers of the DCR and then use them to populate my array .Each container has a no. of items.How can all the containers be used in one go to populate a javascript array?
<img src="{iw_iterate list='dcr.Personal' var='pf'} {iw_value name='pf.image'/} {/iw_iterate}" alt="{iw_iterate list='dcr.Personal' var='pf'} {iw_value name='pf.image alt tag'/} {/iw_iterate}" width="105" height="80" border="0"/>
var img_list = new Array();var alt_list = new Array();var idx = 0;<iw_iterate list='dcr.Personal' var='pf'> img_list[<iw_value name="iw_iteration"/>] = "<iw_value name='pf.image'/>"; alt_list[<iw_value name="iw_iteration"/>] = "<iw_value name='pf.image alt tag'/>";</iw_iterate>
<img src="{iw_iterate list='dcr.Personal' var='pf'} {iw_value name='pf.image'/} {/iw_iterate}" alt="{iw_iterate list='dcr.Personal' var='pf'} {iw_value name='pf.image alt tag'/} {/iw_iterate}" width="105" height="80" border="0"/> The above will iterate all values within a single img-tag - which I don't think will do you much good.I believe the suggestion was to use the iteration to fill an array - something like (NOTE: untested)var img_list = new Array();var alt_list = new Array();var idx = 0;<iw_iterate list='dcr.Personal' var='pf'> img_list[<iw_value name="iw_iteration"/>] = "<iw_value name='pf.image'/>"; alt_list[<iw_value name="iw_iteration"/>] = "<iw_value name='pf.image alt tag'/>";</iw_iterate>The above should, I believe, create a javascript array with all the values you want - and then you need to do whatever one does with the javascript array to do the rotating images (I could figure it out by googling it, but this isn't my problem to solve)
Please tell whats wrong with this script.I have designed it keeping in mind- A page has to be generated where 1 out of 5 images (added to an array through dct) will be loaded randomly each time the page is refreshed. Please look for error within PT tags.
Hi I have attached the presentation template and the the datacapture.cfg .I have tried doing the things - Here , when the rotaion is on ,the user can enter either an image or a text through the dct these will be pushed into a javascript array arrRotElements , which in turn will be appended to a perl variable as string. This variable will be called later in the html code along with the randomizing javascript function . If the script works the the page will display image or text depending on the array element randomly picked on every page load . But there is some error in the presentation template an I am unable to figure out what it is. Please tell what it is if u notice some thing!Thankshomesick123
...# declare variables in scope if ($pof_rotate eq "on") {my @img_items = iwpt_dcr_list('dcr.pof.Rotationable_Section');my $count = 0; foreach $img_item (@img_items) {my $pof_obj_type = iwpt_dcr_value('img_item.Object_Type'); if ($pof_obj_type eq "img") {my $pof_img_alt = iwpt_dcr_value('img_item.image alt tag');my $pof_link = iwpt_dcr_value(img_item.link');# pof_obj_imgSWF appears to be unused $pof_obj_imgSWF = iwpt_dcr_value('img_item.Object_ImgOrSwf'); $rot_pf .= qq(arrRotElements[$count] = "<a href='$pof_link' alt=''><img src='$pof_imgSWF' alt='$pof_img_alt' width='175' height='87' border='0'/></a>";\n); } if ($pof_obj_type eq "txt") {my $pof_obj_txt = iwpt_dcr_value('img_item.Object_Text'); $rot_pf .= qq(arrRotElements[$count] = "$pof_obj_txt"; } ++$count; } }...
$pof_content
$D
my $rot_pf = q();
Have you tried debugging the PT using iwpt_compile.ipl with the -ocode flag? ...# declare variables in scope if ($pof_rotate eq "on") {my @img_items = iwpt_dcr_list('dcr.pof.Rotationable_Section');my $count = 0; foreach $img_item (@img_items) {my $pof_obj_type = iwpt_dcr_value('img_item.Object_Type'); if ($pof_obj_type eq "img") {my $pof_img_alt = iwpt_dcr_value('img_item.image alt tag');my $pof_link = iwpt_dcr_value(img_item.link');# pof_obj_imgSWF appears to be unused $pof_obj_imgSWF = iwpt_dcr_value('img_item.Object_ImgOrSwf'); $rot_pf .= qq(arrRotElements[$count] = "<a href='$pof_link' alt=''><img src='$pof_imgSWF' alt='$pof_img_alt' width='175' height='87' border='0'/></a>";\n); } if ($pof_obj_type eq "txt") {my $pof_obj_txt = iwpt_dcr_value('img_item.Object_Text'); $rot_pf .= qq(arrRotElements[$count] = "$pof_obj_txt"; } ++$count; } }...Below this you reference $pof_content but I have no idea where that's getting set since this is only a partial PT.Do you really want to set and return this $D even if Rotation is "off"?If not - you should initialize $D and move the explicit setting of $D to within the if(){...} clause.When you declare variables prior to usage you should initialize those variables properly (e.g.: my $rot_pf = q();)However, the variables should be declared in scope as possible.Once you get this done - if the javascript code still isn't working for you - make sure it looks correct in the generated page.If it looks correct - post the code from the generated page (someone may help you and then you can figure out how to fix the Perl code to generate it correctly).If it doesn't look correct, you need to keep working on the Perl code in order to get it to look correct.
Please give the syntax of iwpt_compile.ipl . I tried compiling but got the message < error >Could not open presentation template : gateway.tpl< / error > I had given > iwpt_compile.ipl -pt gateway.tpl -ocode abc.iplIs vpath to the presentation template required ?
Hi I am attaching the tpl file .I got the preview and generate error upon trying to generate the dcr. So I tried debugging the tpl file- home.txt using iwpt_compile.ipl, please see the jpg file for the results. The results are really vague please help me find the actual cause for the Preview and Generate error. Thanks