HTML5 Data Bindings Support Product Page
Solved
How do I solve this conditional problem?
Reported 15 May 2014 15:00:30
1
has this problem
15 May 2014 15:00:30 Andre Bender posted:
I've created a timeline with php nad bootstrap. Now I'd like to convert it into HTML 5 DB in order to animate it. I have the classic php code that's working:<?php do { ?>
<?php if ("".$row_rsHistory['TimelinePosition'] ."" == "right") { ?>
<div class="col-md-6 col-md-offset-6" data-align="right">
<?php } else { ?>
<div class="col-md-6"> <?php } ?>
<div class="timeline_box">
<div class="date"><?php echo $row_rsHistory['Jahr']; ?></div>
<p><?php echo $row_rsHistory['Event']; ?></p>
</div><!-- end timeline box -->
</div>
<?php } while ($row_rsHistory = mysql_fetch_assoc($rsHistory)); ?>This creates a text on the left and a year on the right for records with "TimelinePosition=left" and the other way around for records "TimelinePosition=right".
Now I tried the following code with your extension but it not working correctly:
<div class="col-md-6 {{(TimelinePosition == "right").then("col-md-offset-6")}}" data-align="{{(TimelinePosition == "right").then("right")}}" data-binding-repeat="{{dsHistoryEN.data}}" data-binding-id="repeat1">
div class="timeline_box">
div class="date">{{Jahr}}</div>
<p><div data-binding-html="{{Event}}"></div></p>
</div>
</div>Thanks for any help.
Replies
Replied 15 May 2014 15:38:21
15 May 2014 15:38:21 Teodor Kuduschiev replied:
Hello Andre,
Could you please provide a link to your current page?
Could you please provide a link to your current page?
Replied 15 May 2014 16:00:33
15 May 2014 16:00:33 Teodor Kuduschiev replied:
As far as i understand your idea - this should work for you:
<div class="{{TimelinePosition.contains( "right" ).then( "col-md-6 col-md-offset-6", "col-md-6" )}}" data-align="{{TimelinePosition.contains( "right" ).then( "right", "" )}}">
<div data-binding-hide="{{TimelinePosition == 'right'}}" class="timeline_box">
<div class="date">{{Jahr}}</div>
<p data-binding-html="{{Event}}"></p>
</div>
<!-- end timeline box -->
</div>
Replied 15 May 2014 16:38:24
15 May 2014 16:38:24 Andre Bender replied:
Tahnks so far Teodor, but it's not yet working properly. I send you the link @ your supprot E-Mailaddress.

