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

Home: Products: CMS Builder:
Creating Menus

 

 


Cathy
User

Jun 5, 2008, 10:21 AM

Post #1 of 5 (530 views)
Shortcut
Creating Menus Can't Post

Here is the situation I want to create:

For each sections DETAIL page I want to include:
1) the content for that particular detail record
2) a submenu for that section that pulls all the records for the section.

I have been able to create the template that sort of works. Here's my issue....

If I have these require items:


Code
list($companyRecords, $companyDetails) = getRecords(array( 
'tableName' => 'company',
'where' => whereRecordNumberInUrl(1),
'allowSearch' => '0',
));
$companyRecord = $companyRecords[0]; // get first record


The page displays as seen here:
http://www.fametrics.com/test/template2.php?About_Us-3
Where the page content displays fine, BUT the other two pages I have in that section do not show or link in the side navigation. Here's how the other two pages display:
http://www.fametrics.com/test/template2.php?About_the_Firm-1
http://www.fametrics.com/test/template2.php?contact-4

If I change the requires to:


Code
list($companyRecords, $companyDetails) = getRecords(array( 
'tableName' => 'company',
'allowSearch' => '0',
));
$companyRecord = $companyRecords[0]; // get first record


... basically just removing the "where" statement, the side navigation WILL include all three records, and their associated page links are correct, but regardless of the link I click on the last record's content (the Contact Page) displays in the page body.

Here's the code for the navigation:


Code
  <div class="nav"> 
<ul>
<li>HOME</li>
<li>COMPANY</li>
<ul>
<?php foreach ($companyRecords as $companyRecord): ?>
<li> &raquo; <a href="<?php echo $companyRecord['_link'] ?>"><?php echo $companyRecord['title'] ?></a></li>
<?php endforeach; ?>
</ul>
<li>OUR SERVICES</li>
<li>EVENTS</li>
<li>SURVEYS</li>
<li>ARTICLES</li>
<li>CONTACT</li>
</ul>
</div>


And here is the code for the content section:


Code
<?php echo $companyRecord['title'] ?> 
<?php echo $companyRecord['content'] ?><br/>
<a href="<?php echo $companyDetails['_listPage']; ?>">&lt; Back to list page</a> -
<a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>


The insert codes don't change either either scenario...just the requires code.

As you can see, I am just getting started on all this and links aren't coded, content is generic ,etc. Right now I'm just trying to get a handle on how everything works and works together before I jump in with both feet!

Any suggestions on how to solve this problem? Or better yet, tell me I am overlooking some code that automatically inserts a fully working dynamic menu/submenu! Wink
__________________________________
InternetOne.net



Dave
Staff / Moderator


Jun 5, 2008, 11:43 AM

Post #2 of 5 (526 views)
Shortcut
Re: [Cathy] Creating Menus [In reply to] Can't Post

Hi Cathy,

Try including 2 sets of viewer code. One to load the selected page and one to list ALL pages for the menu. Try this:


Code
// load selected page 
list($companyRecords, $companyDetails) = getRecords(array(
'tableName' => 'company',
'where' => whereRecordNumberInUrl(1),
'allowSearch' => '0',
));
$companyRecord = $companyRecords[0]; // get first record

// load all pages for menu (put this second)
list($companyRecords, $companyDetails) = getRecords(array(
'tableName' => 'company',
'allowSearch' => '0',
));


Give that a try and let me know if it fixes it. If it doesn't we may need to change the name of a $variable, but I think that might do the job.

Hope that helps, let me know how it goes.

Dave Edis - Senior Developer
interactivetools.com


Cathy
User

Jun 5, 2008, 12:21 PM

Post #3 of 5 (521 views)
Shortcut
Re: [Dave] Creating Menus [In reply to] Can't Post

Dave,

I inserted/replaced the code and now it's doing the thing where the pages are in the navigation with the correct links, but the page content never changes.

Take a look at:
http://www.fametrics.com/test/template2.php?About_Us-3
And click on some of the side links.

Thoughts? Thanks Dave!
__________________________________
InternetOne.net



(This post was edited by Cathy on Jun 5, 2008, 12:38 PM)


Dave
Staff / Moderator


Jun 5, 2008, 1:05 PM

Post #4 of 5 (513 views)
Shortcut
Re: [Cathy] Creating Menus [In reply to] Can't Post

Hi Cathy,

Ok, I think I got it. The menu code is overwriting $companyRecord. Try renaming the variable in the menu code:


Code
  <div class="nav">  
<ul>
<li>HOME</li>
<li>COMPANY</li>
<ul>
<?php foreach ($companyRecords as $record): ?>
<li> &raquo; <a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></li>
<?php endforeach; ?>
</ul>
<li>OUR SERVICES</li>
<li>EVENTS</li>
<li>SURVEYS</li>
<li>ARTICLES</li>
<li>CONTACT</li>
</ul>
</div>


Let me know if that does it.

Dave Edis - Senior Developer
interactivetools.com


Cathy
User

Jun 5, 2008, 1:23 PM

Post #5 of 5 (507 views)
Shortcut
Re: [Dave] Creating Menus [In reply to] Can't Post

PERFECT! Smile Worked like a charm. Thanks Dave!
__________________________________
InternetOne.net


 
 
 


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