Can’t figure out how to use and place images...

6 posts by 2 authors in: Forums > CMS Builder
Last Post: May 7, 2008   (RSS)

By einslistir - May 6, 2008 - edited: May 6, 2008

Hello, CMS Builder friends!

I feel like I am in a kind of big trouble, because there are lots of things, I can’t figure out with this outstanding CMS script. I am almost giving up hope, but now I have to take benefit from your very good support.

My biggest problem is images, especially on the frontpage, but also other places. I can’t figure out, how to place them, e.g. when using the align command, pushing the image to the left or right side.

Take a look at the mid section on the frontpage here (http://televarp.fo.space2u.com/index.php) how it looks on the actual homepage, and here (http://televarp.fo.space2u.com/index.htm) how I would like it to look like.

My biggest confusion is placing commands like <?php foreach ?> and <?php endforeach ?>, and also I can’t figure out why there is only one thumbnail on the “real” frontpage. All the news stories have big images AND thumbs.

Also I would like to know, how I could swap the images, so the first one is aligning to the left and the next one to the right. Also the <hr> command between the news items gives me trouble, because it doesn’t always go beyond the image, but that is another matter of not that big importance.

Well, a whole lot of confusion, but hopefully some of you understand, what I mean, and how to help me out...!

Re: [einslistir] Can’t figure out how to use and place images...

By Dave - May 6, 2008

hi einslistir, we're here to help! :)

You can pretty much have it display any way you want. What do you want displayed on the front page?

Here's some custom code you can use to rotate back and forth between left and right for the images:

align="<?php echo (@$row++ % 2) ? "left" : "right"; ?>"

Not that that assumes you'll only have one image per row.

Hope that helps. Let me know how else you'd like it different and we can help you get it sorted out!
Dave Edis - Senior Developer
interactivetools.com

Re: [einslistir] Can’t figure out how to use and place images...

By Dave - May 7, 2008

I see. You want a record list, so keep the first part "Step1: Load Record List".

You don't want to load an individual record on this page, so erase the part called "STEP1: Load Record (Paste ...)".

Next, find this line and press enter a few times after it:
<?php foreach ($tidindiRecordList as $tidindiRecord): ?>

The move "STEP3: Display Uploads" inside of that.

Hope that makes sense! Feel free to attach the file if you need more help. Also, if you're not too far along you may consider upgrading. The latest version generates list page code including images for you and is a little simpler.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Can’t figure out how to use and place images...

By einslistir - May 7, 2008

Thanks for the quick and very helpful reply!

Now I have tried with some tables to get the most out of the layout, which seemes not to be in my hands in the same way, I am used to. Guess, it is some of the php code, that confuses me...

Still I haven’t found out, why the code seemes to do linebreakes everywhere. As I told in the message before, it is not possible to have e.g. date and summary at the same line, without getting some linebreaks, that I don’t want to have.

Also the text (summary) should start at the same height as the picture, but there always seemes to be linebreaks, that pushes the text a little bit down. What is the solution to that?

Sounds great with the new upgrade, that let me handle e.g. images a little bit easier. As you see, it is a little problem to me. If I upgrade, will there be any need for a backup first, or will the replacements with the upgrade just do things a little easier to handle?

The index.php file is attached.
Attachments:

index_003.php 17K

Re: [einslistir] Can’t figure out how to use and place images...

By Dave - May 7, 2008

The trick is to do the PHP part last. If you do the HTML and PHP at the same time it's confusing.

All of the spacing issues are to do with HTML, not CMS Builder. CMS Builder can output content exactly like any you could custom code. The wysiwyg sometimes adds paragraph tags though.

Start with an HTML mockup. If you want to base it off your index.htm then use that same HTML. Or if you want to switch to a table based design then do a mockup first so you can figure out any spacing or design issues in HTML first.

One easy way to do that is just save a copy of the page output by index.php and adjust to html to see what the problem is. That will help you find the problem fast.

One thing I did notice is an extra break here. Try removing that:

<!-- STEP3: /Display Uploads from 'uploads' -->
<br/> <?php echo $tidindiRecord['summary'] ?>


On the upgrade, it generates different code but gives you a menu to choose what you want on the generated pages. All the old code will work still, though. Upgrading is almost always seamless, but it's a good idea to always make a backup first.

Hope that helps, let me know how it goes!
Dave Edis - Senior Developer
interactivetools.com