splitting first image

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 5, 2012   (RSS)

By loccom - April 7, 2012

Hi

I did a search but coud not find anything. So i will ask you guys how i can acheive the following.

I wish to make a set of articles. In the article the first thing you see is an image with is alined left and the text wraps this photo.

But when 2 photos are added their is the problem of 2 photos in my text.

so, 2 questions.

1. How can I split the first photo, have that showing and have the remaining photos at the bottom of the article.

2. Is it possible to make tags like the "article manager" to tag in photos in to the article, making a large article full of pictures and text wrapping them?

many thanks

Re: [loccom] splitting first image

By gkornbluth - April 9, 2012

Hi Locom.

Here's a recipe from my CMSB Cookbook thecmsbcookbook.com that might get you started on working out an answer to your first question. (I'm not sure I understand the second question)

Hope it helps.

Best,

Jerry Kornbluth

COUNTING IMAGES IN A MULTI-IMAGE UPLOAD FIELD

I needed to count the number of images that existed in a multi-image upload field that was the only record in my editor, so that if there was only one image I could display it as an image and if there was more than one image I could display them as a slide show.

I started out with another recipe in the Cookbook called: LIMITING THE NUMBER OF IMAGES ON A PAGE AND SHOWING CODE IF EXCEEDED (just above this one)

The basic approach in that recipe is:
<?php foreach ($home_page_slidesRecords as $record): ?>
<?php $count = 0; ?>
<?php foreach ($record['image'] as $upload): ?>
<?php $count++; ?>
<?php endforeach; ?>
<?php echo $count>1 ? "There is more than one thumbnail" : "There is only one thumbnail" ; ?>
<?php endforeach; ?>

I modified the code so that instead of messages, the required code was inserted into the page. I also added a checkbox field to allow the client to decide if they wanted to use this as a slide show regardless of how many images were uploaded. I also added <?php shuffle($record['images']) ?> to the code to randomize the image displayed when there was no slide show.
<?php foreach ($home_page_slidesRecords as $record): ?>
<?php $count = 0; ?>
<?php foreach ($record['image'] as $upload): ?>
<?php $count++; ?>
<?php endforeach; ?>
<?php if ($count > 1 && $home_page_slidesRecord['slideshow'] == 1): ?>
<div id="show" class="slideshow"></div>
<?php else: ?>
<?php shuffle($record['images']) ?><?php foreach ($record['image'] as $upload): ?><img src="<?PHP echo $upload['thumbUrlPath'] ?>" width="<?PHP echo $upload['thumbWidth'] ?>" height="<?PHP echo $upload['thumbHeight']
?>" alt="" />
<?PHP endforeach ?>
<?php endif ?>
<?php endforeach; ?>

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] splitting first image

By loccom - May 5, 2012

Hi

Sorry the delay in responding

I still have the issue.

Thanks for your input, and I managed to make a random strip using the code supplied.

But what I am really looking for is the ability to stagger photos through an article.

The old article manager would allow me to add photos, AM would generate tags for me to distribute through the article.

How can i split photos to distribute, or at least have one photo at the top and other photos at the bottom?

thanks