Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Help needed to add content from multiple sections on one page

 

 


aharrow
New User

Aug 6, 2008, 7:58 AM

Post #1 of 12 (1764 views)
Shortcut
Help needed to add content from multiple sections on one page Can't Post

I was very impressed with you Realty Manager and decided to give your CMS a try. However i need some help in adding content from multiple sections on one page.

Example on my home page i would like a News Article listing (which i have already done using:

<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/control/lib/viewer_functions.php";

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'perPage' => '1',
)); ?>

to combine with other sections for instance summary aticles or a summary of the about us.

<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/control/lib/viewer_functions.php";

list($aboutRecords, $aboutMetaData) = getRecords(array(
'tableName' => 'about',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$aboutRecord = @$aboutRecords[0]; // get first record
?>

Can you explain how i can get this accomplished and keep in mind i would like to add more than 2 sections.

Thank you and keep up the good work


Dave
Staff / Moderator


Aug 6, 2008, 10:53 AM

Post #2 of 12 (1750 views)
Shortcut
Re: [aharrow] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi aharrow,

Is it working right now? And do you need to sections to interact with each other at all? You should be able to just have both blocks of code at the top of the page like you have it. You can however remove some duplicate code and reduce it to this if you like:

<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/control/lib/viewer_functions.php";

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'perPage' => '1',
));

list($aboutRecords, $aboutMetaData) = getRecords(array(
'tableName' => 'about',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$aboutRecord = @$aboutRecords[0]; // get first record

?>

And then display $newsRecords and $aboutRecord where ever you want on the page.

Let me know if that will work for you or if you need something else.

Dave Edis - Senior Developer
interactivetools.com


aharrow
New User

Aug 6, 2008, 11:04 AM

Post #3 of 12 (1749 views)
Shortcut
Re: [Dave] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi Dave this is exactly what i need and it works, however the News Section is a listing and when i select NEXT the About Us generates and error.

Have a look at a demo site: http://www.greenparrothotel.com/opsr/index.php

The only parts the are active are the News and About Us Sections on the home page.

This is the error msg generated on the About Us Section: "Warning: Invalid argument supplied for foreach() in D:\hshome\greenparrot\greenparrothotel.com\opsr\index.php on line 255"


Dave
Staff / Moderator


Aug 6, 2008, 11:17 AM

Post #4 of 12 (1744 views)
Shortcut
Re: [aharrow] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi aharrow,

Ahh, I see. Try removing this line from the about code:
'where' => whereRecordNumberInUrl(1),

And then adding this line:
allowSearch => false,

Then it will always just load the first record, and ignore any search terms if the url (if you add those later). So your code will look like this:

list($aboutRecords, $aboutMetaData) = getRecords(array(
'tableName' => 'about',
'allowSearch' => false,
'limit' => '1',
));

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com


(This post was edited by Dave on Aug 6, 2008, 11:33 AM)


aharrow
New User

Aug 6, 2008, 11:30 AM

Post #5 of 12 (1743 views)
Shortcut
Re: [Dave] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi Dave,

Works like a charm, but for anyone else who needed this the last suggestion from dave was missing the quote:

'allowSearch' => false, and not allowSearch => false,

Thank you very much for your assistance.


Dave
Staff / Moderator


Aug 6, 2008, 11:33 AM

Post #6 of 12 (1741 views)
Shortcut
Re: [aharrow] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Thanks, I'll update my post above. Glad it's working now!

Dave Edis - Senior Developer
interactivetools.com


HDLLC
User

Aug 28, 2008, 4:44 AM

Post #7 of 12 (1053 views)
Shortcut
Re: [Dave] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi there-

I'm trying to do something very similar - but ran into a problem on one particular instance - hoping maybe someone here can point me in the right direction.

I want the description of the location of a property to show everywhere it is listed for SEO. But this snippet from the top of the page makes things odd where used:

http://www.fretwellland.com/missouri-illinois-hunting-land-for-sale.php?01-MO-1010-24

Notice that the headline of: Northeast Missouri Hunting Land for sale in Shelby County, Missouri

I want that to show in my pages that have the listings view or search results:
http://www.fretwellland.com/listings-missouri-illinois-hunting-land-for-sale.php?state=IL

But, when I use the step 1 code at the top of the page, it will insert the information - but it's the same info in every instance.

Here's what I am placing:

Code
<?php 
require_once "/Library/WebServer/WebSites/fretwellland/public_html/cmsAdmin/lib/viewer_functions.php";

list($propertiesRecords, $propertiesMetaData) = getRecords(array(
'tableName' => 'properties',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$propertiesRecord = @$propertiesRecords[0]; // get first record

?>


and within the pages I am using this to describe the property:


Code
<?php echo $propertiesRecord['geographic_location'] ?> <?php echo $propertiesRecord['state_long'] ?> <?php echo $propertiesRecord['type_of_property'] ?> for sale in <?php echo $propertiesRecord['county'] ?> County, <?php echo $propertiesRecord['state_long'] ?>.


Any help is greatly appreciated!

Thanks in advance!

--Jeff


Dave
Staff / Moderator


Aug 28, 2008, 8:27 AM

Post #8 of 12 (1030 views)
Shortcut
Re: [HDLLC] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi Jeff,

Just so I'm clear - do you want that description in the url?

So instead of:
http://www.fretwellland.com/missouri-illinois-hunting-land-for-sale.php?01-MO-1010-24

You'd have:
http://www.fretwellland.com/missouri-illinois-hunting-land-for-sale.php?Northeast-Missouri-Hunting-Land-for-sale-in-Shelby-County-Missouri-24

Is that right? Or is there something else you're trying to do?

Let me know and I'll help you with it.

Dave Edis - Senior Developer
interactivetools.com


HDLLC
User

Aug 28, 2008, 8:40 AM

Post #9 of 12 (1028 views)
Shortcut
Re: [Dave] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi Dave-

Thanks for the quick response!

Not exactly...

I want to use that code, or inclusion of the information that describes a property.

I just want to put it in the page - but I keep throwing errors or it wants to put the same info (state, county, etc.)

But - when I get it to work using that code I posted - I get the same property type, state, county, etc. - in each instance (all 25 listings on the page).

So, I'm close - just not all the way there...

Make sense?

--Jeff


Dave
Staff / Moderator


Aug 28, 2008, 2:47 PM

Post #10 of 12 (1018 views)
Shortcut
Re: [HDLLC] Help needed to add content from multiple sections on one page [In reply to] Can't Post

I'm still not totally clear, sorry about that! :)

So on this page:
http://www.fretwellland.com/listings-missouri-illinois-hunting-land-for-sale.php?state=IL

You want a field from each listing to show at the top above the listings where you have:

Northeast Missouri Hunting Land For Sale - Western Illinois Hunting Land For Sale
Northeast Missouri Farms For Sale - Western Illinois Farms For Sale

Am I any closer? Can you post an url to the page with errors and attach your viewer file?

Dave Edis - Senior Developer
interactivetools.com


PixelFusion
New User

Sep 30, 2008, 8:43 AM

Post #11 of 12 (526 views)
Shortcut
Re: [aharrow] Help needed to add content from multiple sections on one page [In reply to] Can't Post

I have a very similar thing I want to accomplish. I was able to get the list page working but I'm having problems with the details page. I need to combine the following.


Code
   

<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/home/cmsdemo/www/cmsdemo.pixelfusion3.net/cmsAdmin/lib/viewer_functions.php";

list($solutionsRecords, $solutionsMetaData) = getRecords(array(
'tableName' => 'solutions',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$solutionsRecord = @$solutionsRecords[0]; // get first record

?>



AND


Code
   

<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/home/cmsdemo/www/cmsdemo.pixelfusion3.net/cmsAdmin/lib/viewer_functions.php";

list($menuRecords, $menuMetaData) = getRecords(array(
'tableName' => 'menu',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$menuRecord = @$menuRecords[0]; // get first record

?>



I tried the following but it only shows the first item.


Code
   

<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
require_once "/home/cmsdemo/www/cmsdemo.pixelfusion3.net/cmsAdmin/lib/viewer_functions.php";

list($solutionsRecords, $solutionsMetaData) = getRecords(array(
'tableName' => 'solutions',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$solutionsRecord = @$solutionsRecords[0]; // get first record

list($menuRecords, $menuMetaData) = getRecords(array(
'tableName' => 'menu',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$menuRecord = @$menuRecords[0]; // get first record

?>



Jake
Staff / Moderator


Oct 1, 2008, 7:37 PM

Post #12 of 12 (479 views)
Shortcut
Re: [PixelFusion] Help needed to add content from multiple sections on one page [In reply to] Can't Post

Hi PixelFusion,

Try following Dave's instructions in this post (also note the small correction in its following post):

http://www.interactivetools.com/iforum/gforum.cgi?post=64395;search_string=allowSearch%20%3D%3E%20false%2C;t=search_engine#64395

Let us know if that does the trick. Smile
-----------------------------------------------------------
Cheers,
Jake Swanson - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.


 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4