Category Menu Question
12 posts by 2 authors in: Forums > CMS Builder
Last Post: May 14, 2009 (RSS)
By greatjakes - May 2, 2009
Current Investment
- current 1
- current 2
- current 3 (about 20 items)
Prior Investment
- prior 1
- prior 2
- prior 3 (about 20 items)
Here is my problem:
At some point the status of an item will be changed from “current investment” to “prior investment”. When this happens, changes should be reflected on both the menu and the list/detail pages. Here are links to mockups:
Top level page:
http://gjdemo.com/irving/our_investments.htm
Example of sub menu under “current investment”:
http://gjdemo.com/irving/current_investment.htm
Example of submenu when it’s moved from “current investment” to “prior investment”
http://gjdemo.com/irving/prior_investment.htm
Is this possible with the cms? I'm really stuck on how to to go about doing this, any help would be greatly appreciated.
Thanks!
Re: [greatjakes] Category Menu Question
By greatjakes - May 5, 2009
Re: [greatjakes] Category Menu Question
By ross - May 5, 2009
Thanks for posting!
I think we actually just talked about this on the phone :). As a re-cap though, you'll defintiely be able to set this all up.
You can create your section as either a category menu or a multi list section. In my head it feels more like a multi list but it really doesn't matter. Either one will work pretty much the same way.
Now, having said that, make sure you only set up one section for your items. You don't need a section for prior investments and a separate section for current investments. If you do it that way, you'll need to re-enter all the details over and over each time you switch the investment from one list to the other.
What you do instead is create a one section and put a field on there called "Kind of Investment". Set it up as a drop down menu with two options: Prior and Current.
Then you just switch that back and forth to get your items appearing on different lists.
Make sense? Keep me up to date with how you are making out and feel free to post any addition questions you have :).
Cheers,
Ross Fairbairn - Consulting
consulting@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: http://www.interactivetools.com/consulting/
Re: [ross] Category Menu Question
By greatjakes - May 5, 2009 - edited: May 5, 2009
I created the list as you instructed and got as far as creating two list viewer pages for each section.
http://gjdemo.com/irving/html/currentList.php
http://gjdemo.com/irving/html/priorList.php
There are couple of things I need help with:
- How do link them to different detail pages? If you recall from our conversation earlier, each viewer page needs to go to different detail page because of the navigation flipping.
- On detail pages, how do I get all the sub menus in that section to appear? (right now only selected one shows up).
- How do I make the selected submenu highlighted in the detail page? (my intention is to make them underlined.)
I've also attached the php files in case you need to look at them.
Thanks again for all your help.
Re: [greatjakes] Category Menu Question
By ross - May 6, 2009
Glad to see you got a jump on this one so quickly :). The best way to move forward will be to go over everything one at a time.
For the links to your detail page, you'll need to hardcode the url.
So where you have the Read More link, you'll need to use something like this:
<a href="currentDetailPage.php?<?php echo $record['num']; ?>">
The bit of PHP in there makes sure the record number is un the URL so your detail page knows what to load.
Does that make sense? Let me know what you think :).
Cheers,
Ross Fairbairn - Consulting
consulting@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: http://www.interactivetools.com/consulting/
Re: [ross] Category Menu Question
By greatjakes - May 6, 2009
I put the code in the list pages and they are now linking to different details pages.
What's our next step to get the submenus working on detail pages?
Thanks again for all your help!
Re: [greatjakes] Category Menu Question
By ross - May 7, 2009
Do you have anything happening on the detail pages right now? Like, do you have the record's content appearing?
The code that makes your list on the left appear is going to be the same as it is on your list pages so you can copy that part over and stick it on your detail page in the appropriate place. Make sure you also copy the viewer code that's up at the top of the page. That's needed as well.
This will get the basic list appearing. Once you get there, we'll look at a bit of "if" code that will make the current record get underlined (or some sort of style).
Keep me up to date. If you run into any trouble, just post a copy of the your detail page to a post and I'll see what I can do.
Thanks!
Cheers,
Ross Fairbairn - Consulting
consulting@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: http://www.interactivetools.com/consulting/
Re: [ross] Category Menu Question
By greatjakes - May 7, 2009
I got the detail pages working with the right content and submenus. One question about the URL display. If I click on the submenu the URL it displays is something like this: [url "http://gjdemo.com/irving/html/priorDetail.php?/irving/html/currentDetail.php?New-York-Company-11"][url "http://gjdemo.com/irving/html/priorDetail.php?/irving/html/currentDetail.php?New-York-Company-11"]http://gjdemo.com/irving/html/priorDetail.php?/irving/html/currentDetail.php?New-York-Company-11[/#000000][/url]
I[/url] guess this happens because I hard coded the details page links. Just wondering if there is a better way to display the URLs?
Now I just need to figure out how to get the selected item underlined. Thanks again for all your help!
Here is what I have on the detail page:
<?php
require_once "D:/inetpub/gjdemo/cmsadmin/lib/viewer_functions.php";
list($menuRecords, $menuMetaData) = getRecords(array(
'tableName' => 'investment',
'where' => 'investment_type = "Current"',
));
list($investmentRecords, $investmentMetaData) = getRecords(array(
'tableName' => 'investment',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
?>
For Submenu Display:
<?php foreach ($menuRecords as $record): ?>
<div class="submenu">
<a href="currentDetail.php?<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a><br/>
</div>
<?php endforeach; ?>
<?php if (!$menuRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
For Content Display:
<?php foreach ($investmentRecords as $record): ?>
<tr>
<td class="detailtext">
<div class="head"><?php echo $record['title'] ?></div>
<?php echo $record['description'] ?><br/>
</td>
<td class="detaillogo">
<?php foreach ($record['logo'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php endif ?>
<?php endforeach ?>
</td>
</tr>
<?php endforeach; ?>
<?php if (!$investmentRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
Re: [greatjakes] Category Menu Question
By ross - May 8, 2009
Great! I see the problem with your links. Where you have this:
<a href="currentDetail.php?<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a>
try taking out the title part so you just have this:
<a href="currentDetail.php?<?php echo $record['_link'] ?>"></a>
The _link part already puts the article title into the link so you are basically just doubling that up.
Now, the next thing I am seeing is that for the section you have listed as displaying the content of the page, it really looks like you are using list view code. While that does seem to be working, it won't let us do what I was thinking of for highlighting the correct menu item.
Could you do the setup for the content part again and use the detail page code instead? Basically, when it's setup as a detail view, all the values are global and can be used anywhere on the page. When you have it setup as a list view, you can only use the varialbes in that forloops.
We need to be able to check the name of the full detail article you are displaying and compare it to each of the names being listed in your sub menu.
Have another look at that and let me know when it's good to go.
I look forward to hearing from you :).
Cheers,
Ross Fairbairn - Consulting
consulting@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: http://www.interactivetools.com/consulting/
Re: [ross] Category Menu Question
By greatjakes - May 8, 2009
I took out the extra code and URL displays property now. Thanks. I replaced the code for the content part as you suggested. Below is the code to the detail page. Thanks again for all your help.
Top:
<?php
require_once "D:/inetpub/gjdemo/cmsadmin/lib/viewer_functions.php";
list($menuRecords, $menuMetaData) = getRecords(array(
'tableName' => 'investment',
'where' => 'investment_type = "Current"',
));
list($investmentRecords, $investmentMetaData) = getRecords(array(
'tableName' => 'investment',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$investmentRecord = @$investmentRecords[0]; // get first record
?>
Subnav:
<?php foreach ($menuRecords as $record): ?>
<div class="submenu">
<a href="currentDetail.php?<?php echo $record['num']; ?>"><?php echo $record['title'] ?></a><br/>
</div>
<?php endforeach; ?>
<?php if (!$menuRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
Content:
<?php echo $investmentRecord['title'] ?></div>
<?php echo $investmentRecord['description'] ?><br/>
</td>
<td class="detaillogo">
<?php foreach ($investmentRecord['logo'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php endif ?>
<?php endforeach ?>
</td>
</tr>
<?php if (!$investmentRecord): ?>
No record found!<br/><br/>
<?php endif ?>