Multiple record on separate webpages

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 25, 2010   (RSS)

Hello Everyone!

I have a website where every page has a sidebar where I place an image (each image is different, but its only one image per sidebar). To simplify my life, I was thinking that I should build one multi record editor and store all the images there. However, the more I think about this, the more complicated it seems.

I'm not sure how i would specify which image would go on which page.

What I'm really trying to do is avoid have a pile of edit pages, one for each sidebar!

Does anyone have any ideas on whether my approach would work or if there is another approach?
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [northernpenguin] Multiple record on separate webpages

By Dave - February 24, 2010

Hi northernpenguin,

No, you're on the right track. This can be a good approach.

The trick is figuring out how you want to associate images and pages. A few possible ways include:

- You can specify the image record number in the html/php

- You could use a 'tag' such as "about" or "services"

- You could detect the url, add a field for "url keyword" and only show an image for urls containing "services.php" for example.

Do you have any other content in the sidebar or an easy way to identify which page it is on?

Sometimes what I do is have a generic PHP include and then define a variable before I call it. Like this:

$GLOBALS['sidebarImage'] = "about_us";
<?php include "sidebar.php"; ?>

... then in sidebar.php ...

'where' = " imageTag = '{$GLOBALS['sidebarImage']}' ",

Hope that helps! Let me know if any of those ideas would work for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multiple record on separate webpages

Thanx Dave

I think I will try the tag method first and see how that will work for me.

There is no other content on the side bar, but the page itself is specific.

You can view it at http://www.globalknowledgeware.com/sandbox
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke