Banner CMS
14 posts by 2 authors in: Forums > CMS Builder
Last Post: February 26, 2008 (RSS)
By Berkowitz - February 19, 2008 - edited: February 19, 2008
My page contains banners which I use to put ads in. What i want to do is to be able to put my banner pic in my page through CMS but I also need to be able to position them in different div tags on different pages. Because my ads will be different form page to page. Now i've done it with multiple fiels in my content. ex: AD1 :Banner1 (pic), Banner2(empty), Banner3(empty) ; AD2:
Banner1 (empty), Banner2(pic), Banner3(empty) ; ...
so my code could be
<?php echo $record['Banner1'] ?>
<?php echo $record['Banner2'] ?>
<?php echo $record['Banner3'] ?> (but for my first page I don't need banner 3, so a delete it in my code.)
And now I have to leave out the one's I don't need or don't put anything in them in my CSM but what i really want is to have only one
<?php echo $record['Banner'] ?>
so i mean:
ad1: Banner
ad2: Banner
ad3: Banner
But all three bannerfields contain different pic's. So my PageViewer reads
<?php echo $record['Banner'] ?>
i want to become that in my html i can do
<div id="ad1"><?php echo $record['Banner'] ?></div>
<div id="ad2"><?php echo $record['Banner'] ?></div>
...
but every Banner should contain another pic instead of showing the same one.
Do you know what i mean?
Thans in advance like always
Berkowitz
Re: [Berkowitz] Banner CMS
By Dave - February 19, 2008
Is that right? If not give me some more detail and I'll keep trying! :)
Some questions: Are they text fields or upload fields? And are they extra fields in your content (eg: news, articles) or do you have a separate section editor for banners?
interactivetools.com
Re: [Dave] Banner CMS
By Berkowitz - February 19, 2008 - edited: February 19, 2008
i've put screenshots as attachment.
As you can see in my content.jpg attachment I just want to use 1 field for all my banners, but in every ad there's another pic.
Do you get what want? :). If not just keep asking the information you can use :).
Again thanks for all you're trouble your doing.
Re: [Berkowitz] Banner CMS
By Dave - February 19, 2008
<?php
if ($record['Banner1']) { echo $record['Banner1']; }
else if ($record['Banner2']) { echo $record['Banner2']; }
else if ($record['Banner3']) { echo $record['Banner3']; }
else { echo "No banner available"; }
?>
That way you could use that code and it will always show the first banner that is available in one of those 3 fields.
Is that guess closer?
interactivetools.com
Re: [Dave] Banner CMS
So in my ads I wanna have
Title
Banner
Content
but in every ad, banner is another pic. So now if I use my php code from de php generator
<?php echo $record['banner'] ?>
It would show my banners one by one underneath or next to each other, right?
But what I want is to position every banner in a div tag. Because I have 2 or more ads on a page.
Re: [Berkowitz] Banner CMS
By Dave - February 19, 2008
So you want:
1) All banners printed out (except blank ones)
2) Banners printer beside each other in the HTML
3) Banners to have divs around them
4) Banners to all be in one variable
Is that right?
Here's some code that puts all the banners in one variable with divs around them:
<?php
$banners = "";
if ($record['Banner1']) { $banners .= "<div id='ad1'>{$record['Banner1']}</div>"; }
if ($record['Banner2']) { $banners .= "<div id='ad2'>{$record['Banner2']}</div>"; }
if ($record['Banner3']) { $banners .= "<div id='ad3'>{$record['Banner3']}</div>"; }
?>
Then you could show all banners like this:
<?php echo $banners; ?>
Am I any closer? I'm really trying here... :)
interactivetools.com
Re: [Dave] Banner CMS
those blank fields are erased. I don't what to have blank fields.
the only fiels I have are
Title
Banner
Content
that's how it is made (see attachement).
But in every ad, the pic in banner is different.
there are 2 or more ads i want to show on my page's.
so, in every ad Bannerfield is different.
<?php $record['banner'] ?> this is what i want in a div.
but when i use this he just shows every bannerfield in every div i put my code in. But I just want 1 bannerfield / div tag.
So i need some kind of recognition of which ad he has to show the bannerfield, I think.
sorry for my difficult question ... :) but thanks in advance.
Berkowitz
Re: [Berkowitz] Banner CMS
By Dave - February 20, 2008
You have a "Section Editor" for all your banners and a different section editor for your articles or content. Is that right?
You want to show some random banners from your banner section on your content page.
If that's right, you'd do it with a list viewer and limit the perpage to 3 (or however many banners you wanted) and set the 'where' to match the type of banner you wanted.
Another way, say you had 3 different types of banners (top banners, side banners, and bottom banners). You would use 3 list viewers. One to load each type of banner, and limit it to perpage 1 to only return 1 of each type.
Does that make sense?
interactivetools.com
Re: [Dave] Banner CMS
With a ListViewer I want to show my banners ($record['banner']) in different div tags.
so $record['banner'] contains in every ad a different pic. When i do ListView now he just show every banner of every ad. but I want to be able to filter out so i can show one specific banner in one specific div tag.
Re: [Berkowitz] Banner CMS
By Dave - February 21, 2008
interactivetools.com