close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

repeating region in result.php

Thread began 2/22/2010 9:12 pm by ssemere321379 | Last modified 3/01/2010 2:39 pm by Eric Mittman | 2043 views | 5 replies |

ssemere321379

repeating region in result.php

I am using DataAssist to generate the result.php. I want to make a repeating region of the two lists. I also want the second list to show only if the recordset is even. I tried the EVEN condition for the second LI tag using SHOW REGION IF RECORDSET IS EMPTY then changed the condition
if ($totalRows_rsProducts == % 2 == 0)
it seems to work only if I do not have a repeating region for the both LI items.
The following is the HTML of the result page. I want the two lists to be in one row. Notice the second list has a border to separate both lists.

<ul id="search-width" class="items">
<li>
<a><img src=""/></a><br/>
<span> product name</span><br/>
<strong> productPrice</strong><br/>
<span> SKU </span><br/>
<span>ProductStock?></span><br/>
</li>
<li style="border-left:3px solid #cccccc;">
<a><img src=""/></a><br/>
<span> product name</span><br/>
<strong> productPrice</strong><br/>
<span> SKU </span><br/>
<span>ProductStock?></span><br/>
</li>
</ul>

I tried to make a the two LI tags to be repeating region and SHOW 10 RECORDS AT A TIME.
But I get 20 records.
Making the first LI tag a repeating region results in empty second LI.
Could you please suggest on this?

Sign in to reply to this post

Eric Mittman

So do you have two recordsets that you are using for these repeat regions? I think you should have the repeat regions setup like this:

php:
<ul id="search-width" class="items">


<?php repeat region one start ?>
  <li>
  <a><img  src=""/></a><br/>
  <span> product name</span><br/>
  <strong> productPrice</strong><br/>
  <span> SKU </span><br/>
  <span>ProductStock?></span><br/>
  </li>
<?php repeat region one end ?>

<?php check for rows being even?>
<?php repeat region two start ?>
<li style="border-left:3px solid #cccccc;">
<a><img  src=""/></a><br/>
<span> product name</span><br/>
<strong> productPrice</strong><br/>
<span> SKU </span><br/>
<span>ProductStock?></span><br/>
</li>
<?php repeat region two end ?>
<?php end check 
for rows being even?>

</ul>



This will result in a single unordered list with two sets of entries. The first set will display the total number of records that you specify in the first repeat region. The second will display the total number of rows specified in the second repeat region.

Sign in to reply to this post

ssemere321379

Eric,

I have only one recordset rsProducts since the search variable is only advanced text search. I followed the video in webAssist how to generate search and result pages. Do I need two recordsets?
I just need to present the search results horizontally and vertically, two search results per row.
From what I understand repeating regions of dreamweaver is uni-directional. I read about DataAssist Repeat Selection. But it is not clear for me how to use it in my case.

Sign in to reply to this post

Eric Mittman

You should not be using an unordered list if you want to display the results side by side two at a time.

You should first add in a table with a single row in it. In the <td> add the bindings for the results as you want to see here. Once you have it like that the next thing to do is to use the repeat region around this row to make is show all of the records.

This is where you would apply the repeat selection server behavior from DataAssist. You will select the <td></td> that your bindings are in and apply the server behaviors > DataAssist > repeat selection. In this server behavior specify 2 repetitions.

This should create a results layout that has records repeating two per row until all the records show. Let us know if you have any specific questions about this or if you run into any problems.

Sign in to reply to this post

ssemere321379

Thanks Eric. it works great with tables. One question though. is it possible to have some exceptions in the repeating row? I am thinking to create right borders for each <td> to separate the products. All the <td> could have right borders except the last <td>. What php and how to do it?

Thanks once again.

Sign in to reply to this post

Eric Mittman

If you know the css that you would like to apply then you need to determine what condition to set this styling. You can use php code to set it for you like this:

<?php echo (<if your condition is true>)?"style='<your css here>;'":"" ?>

This says, if the condition is true, print the style info, otherwise print nothing. You just need to determine what the condition is and the style you wan to apply.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...