Photo Adding
2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 28, 2009 (RSS)
By (Deleted User) - January 28, 2009 - edited: January 28, 2009
I am really loving this CMS. Only one issue I am not sure about is.
If I have a product how do I get it to show 2 then post 2 more under that?
For example I use a 2 column table. I have foreach link that the beginning of table 1 and then at the end of that column the end. But how do I tell it to only list 2 and then go to the next row or even the second row of columns this way I can leave a space between row 1 and row 2.
Also with that said. How can I setup so each product has its own Category and it only show under that categories and list that category in a side menu section.
If I have a product how do I get it to show 2 then post 2 more under that?
For example I use a 2 column table. I have foreach link that the beginning of table 1 and then at the end of that column the end. But how do I tell it to only list 2 and then go to the next row or even the second row of columns this way I can leave a space between row 1 and row 2.
Also with that said. How can I setup so each product has its own Category and it only show under that categories and list that category in a side menu section.
Re: [hegadmin] Photo Adding
By Dave - January 28, 2009
Hi hegadmin,
Let's tackle the first problem first. Then we can look at the category issue.
- The first step is to create a mockup of how you want the page to look. It's easy to skip this step but it saves a lot of time in the long run.
- Next, there's a few methods to have 2 columns, one is to put your content in a fixed width div and float it left. The divs will go side by side until there is no more space and then go down to the next line.
- If you don't like the CSS approach you can use this counter code to insert a </tr><tr> every so many rows:
<?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>
- With table tags it looks something like this:
Give that a try and let me know how it works for you.
Hope that helps!
Let's tackle the first problem first. Then we can look at the category issue.
- The first step is to create a mockup of how you want the page to look. It's easy to skip this step but it saves a lot of time in the long run.
- Next, there's a few methods to have 2 columns, one is to put your content in a fixed width div and float it left. The divs will go side by side until there is no more space and then go down to the next line.
- If you don't like the CSS approach you can use this counter code to insert a </tr><tr> every so many rows:
<?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>
- With table tags it looks something like this:
<table border="1">
<tr>
<?php foreach ($records as $record): ?>
<td> ... show record ... </td>
<?php $maxCols=2; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>
<?php endforeach ?>
</tr>
</table>
Give that a try and let me know how it works for you.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com