Category Menu Pulling in Multi page record

16 posts by 3 authors in: Forums > CMS Builder
Last Post: April 21, 2009   (RSS)

Hi
We have set up a category menu system for a site which is fine for single pages but there is one page within the breadcrumb that needs to route to a multi-page record with a 'more info' link to a detail page. We were thinking of hard coding a link to the end of the breadcrumb linking to a different type of section but this doesn't seem very satisfactory.

What is the best strategy for doing this?

Re: [chassa2556] Category Menu Pulling in Multi page record

By ross - March 27, 2009

Hi there.

Thanks for posting!

The categories in CMS Builder right now are setup to link to single pages only. What you could do though is add a field to your categories section called "URL" or something like that.

Then, in the code for displaying your categories, a bit of code that says, if there is value for the URL field, go to that page instead. Otherwise, go to the page you normally work.

Does that sound like it would work?
-----------------------------------------------------------
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 Pulling in Multi page record

Hi Ross

Here is the code I'm using for my category menu

<div id="topMenu">
<ul>
<li>
<?php foreach ($school_2Records as $school_2Record): ?>
<?php echo $school_2Record['_listItemStart'] ?>

<?php if ($school_2Record['_isSelected']): ?>
<a href="<?php echo $school_2Record['_link'] ?>"> | <?php echo $school_2Record['name'] ?></a>

<?php else: ?>
<a href="<?php echo $school_2Record['_link'] ?>"> | <?php echo $school_2Record['name'] ?></a>
<?php endif; ?>

<?php echo $school_2Record['_listItemEnd'] ?>
<?php endforeach; ?>
</a>
<![endif]-->
</ul>
</li>
</div>


Could you let me know how that magic code would look please?

Re: [chassa2556] Category Menu Pulling in Multi page record

By ross - March 27, 2009

Hi there.

I have some code for you to try out. The main thing is that I used "linkOverride" as the name of my field. You can use anything you like though. Just make sure to update the code accordinly.

<div id="topMenu">
<ul>
<li>
<?php foreach ($school_2Records as $school_2Record): ?>
<?php echo $school_2Record['_listItemStart'] ?>

<?php //Ross Code Starts Here ?>
<?php if ($school_2Record['linkOverride']): ?>
<a href="<?php echo $school_2Record['linkOverride'] ?>">
<?php else: ?>
<a href="<?php echo $school_2Record['_link'] ?>">
<?php endif ?>
<?php //Ross Code Ends Here ?>

| <?php echo $school_2Record['name'] ?></a>

<?php echo $school_2Record['_listItemEnd'] ?>
<?php endforeach; ?>
</a>
<![endif]-->
</ul>
</li>
</div>


I put tags around my code so you can sit it better. One thing you'll notice is that I took out the if block that checked whether the category selected or not. You would only need that if the selected category was going to have a different style. Based on your code, the would all look the same.

Give it a shot and let me know how you make out :).
-----------------------------------------------------------
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 Pulling in Multi page record

Hi Ross - have tried this and its still coming up with the error. I think I will send you my log in details and would you mind having a closer look for me please?

Re: [chassa2556] Category Menu Pulling in Multi page record

By ross - March 31, 2009

Hi.

Sounds good. I actually just asked that in the other thread :).

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 Pulling in Multi page record

By Kittybiccy - April 1, 2009

I've been working on a breadcrumb navigation which I've managed to get to work on one section of a site that has three sections! You sent some code to Charlie which I used and have created category menus for each section. The editors in these categories are to be displayed in the breadcrumb navigation.

So I got one of the sections to work fine. I've then copied the code across - changing the table name and anything else needed but I'm getting this error: Warning: Invalid argument supplied for foreach() in /homepages/31/d271660971/htdocs/CMSB/church_end.php on line 79

This is the section in question:
http://www.arcschoolsuk.com/CMSB/church_end.php?1

And the section that is working:
http://www.arcschoolsuk.com/CMSB/napton.php?1

Could anyone tell me what I've done wrong and why it's not working on the second section, I will need to add a third section too with the same breadcrumb too once I get this one sorted!

Hannah

Re: [Kittybiccy] Category Menu Pulling in Multi page record

By ross - April 1, 2009

Hi Hannah

Thanks for getting me your details through email :). I replied to you there as well but for anyone following along, the problem was with variable names.

The viewer code at the top was using variable names from the other section so when they were copied to this new page, they didn't match what was already on the page further down.

Let me know if I can take a look at anything else for 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 Pulling in Multi page record

By Kittybiccy - April 7, 2009

I've got the breadcrumb navigation working on all of the pages now except for when I try and replicate it on a detail page that is coming off of a list page within the breadcrumb navigation.

I get a 'Warning: Invalid argument supplied for foreach() in /homepages/31/d271660971/htdocs/CMSB/ansley_teamDetail.php on line 91.'

The page in question is a detail page for a list page we coded in: http://www.arcschoolsuk.com/CMSB/ansley_teamDetail.php?Test-4-4.
The list page for this works though: http://www.arcschoolsuk.com/CMSB/ansley_teamList.php

Is there something I need to change to get the breadcrumb to work on the detail page because this is coming from a list page or am I just doing something silly?!

Hannah