Adding extra text relating to the URL

11 posts by 2 authors in: Forums > CMS Builder
Last Post: June 18, 2009   (RSS)

Re: [isdoo] Adding extra text relating to the URL

By isdoo - June 15, 2009

I think the answer to the seconds question might be....

<?php if division == hotel: ?>
POSTED AROUND THE CODE TO DISPLAY THE NEWS ITEMS FOR HOTEL DIVISION
<?php endif ?>


Unless there is a simpler method.

Not sure on the first question mind.

Re: [isdoo] Adding extra text relating to the URL

By isdoo - June 15, 2009

Actually this would not work, as I need to pull the 'division' into my page title - so need something for the header section.

Re: [isdoo] Adding extra text relating to the URL

By ross - June 15, 2009

Hi there

There are a couple things happening here so I made some changes to your code. Have a look:

<?php echo @$_GET['division']; ?>
<?php if (@$_GET['division'] == 'hotel'):?><h2>Hotel</h2>
<?php elseif (@$_GET['division'] == 'shop'): ?><h2>Shop</h2>
<?php else: ?><h2>Other Division</h2>
<?php endif ?>


The first thing to notice is that each time you refer to 'division', you always need to have the $_GET in there. The second thing is that I added in "@" each time you have the $_GET. That will get rid of your undefined variable error when you are on just index.php and there is no division specified. The @ basically suppresses the error message.

Try that out and let me know where it gets you to :).
-----------------------------------------------------------
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] Adding extra text relating to the URL

By isdoo - June 15, 2009

Thanks ross.

Any suggestions on only displaying records from one division if we just have index.php and no division in the URL?

Just concerned that someone might enter /news/hotel rather than say /news/hotel/index.php?division=hotel

If we go down the line of putting the pages into seperate folders due to the many customisations in each section.

Just not sure on the route, I will go down yet - but if the later is not an option then I have to think about how to pull in the various bits effectively.

Many thanks.

Re: [isdoo] Adding extra text relating to the URL

By ross - June 16, 2009

Hi there.

Glad that's all working :). If you end up having a separate index page for each division, you just need to put

'where' => "division = 'hotel'"

up in the viewer code. To start with though, don't worry about it. Just make your index pages with the default code and let me have a look. I can show you in more detail how to set them up to be divisions specific.

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] Adding extra text relating to the URL

By isdoo - June 16, 2009

Thanks - must admit CMS Builder is far better than I thought it would be!

It isn't perfect, not because of faults but for features that would make it better (for example would be great to have previous page | next page & Page number at the foot of a list of records rather than having to scroll to the top if you wanted the next page).

I have several 'issues' okay more questions, but they are probably more than a forum is for ( do not feel it is fair to open extra posts), so guess will need to buy some contracting time to get me on the right road.

Thanks again.

Re: [isdoo] Adding extra text relating to the URL

By ross - June 17, 2009

Hi there.

I am glad to hear CMS Builder is working out for you. One thing to keep in mind is that we don't mind at all if you start more threads. That's exactly what we are here for. Post away! We'll be here each step of the way.

Specifically with the next and previous links, you can have them at the top and bottom of any list page you like. There's even a neat way to have next and previous links right on your full detail page so you can scroll from article to article without having to back to the list page.

Let me know if you wanted to go over any of this in more detail.

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] Adding extra text relating to the URL

By isdoo - June 17, 2009

Thanks - I meant within the CMS itself, rather than on the produced pages.

When viewing the list of records etc.

Re: [isdoo] Adding extra text relating to the URL

By ross - June 18, 2009

Hi there.

Thanks for posting!

The interface templates aren't really something we support modification on. The main thing is that eachtime you do an upgrade, those changes will be overridden. If you want, we could have a look at this through consulting (consulting@interactivetools.com). Drop me a line if you are interested :).
-----------------------------------------------------------
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/