show category name at top filtered list page
3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 2, 2009 (RSS)
By wizzle - March 18, 2009
fantastic product so far. I love it, but it makes me feel like an idiot!! [:)]
I'm quite sure this is simple, but an hour of searching got nothing.
my current page is http://www.akmolecular.com/testmenu2.php
On the left if someone clicks a category like "genetics" I want the header of the table to say the category name (Genetics) instead of just saying "Test". If all records are being displayed it should say "All Tests"
My basic thought was
If category doesn't exist print "All test" else print [category]
I tried simpler first not dealing with the if else part and used <?php echo $testsRecord['category'] ?>
and <?php echo $Record['category'] ?>
but only got error
thanks in advance
I'm quite sure this is simple, but an hour of searching got nothing.
my current page is http://www.akmolecular.com/testmenu2.php
On the left if someone clicks a category like "genetics" I want the header of the table to say the category name (Genetics) instead of just saying "Test". If all records are being displayed it should say "All Tests"
My basic thought was
If category doesn't exist print "All test" else print [category]
I tried simpler first not dealing with the if else part and used <?php echo $testsRecord['category'] ?>
and <?php echo $Record['category'] ?>
but only got error
thanks in advance
Greg Williams
Re: [wizzle] show category name at top filtered list page
By ross - March 19, 2009
Hi wizzle
Thanks for posting!
There is likely going to be a better way to do this but for now, try replacing TITLE with this code:
<?php echo @$_GET['category']; ?>
That will display whatever the value of "category" is up in the URL.
That should get the job done but there should also be a way to do it using code from the code generator. If you wanted to attach testmenu2.php to another post, I could take a closer look.
Let me know what you think :).
Thanks for posting!
There is likely going to be a better way to do this but for now, try replacing TITLE with this code:
<?php echo @$_GET['category']; ?>
That will display whatever the value of "category" is up in the URL.
That should get the job done but there should also be a way to do it using code from the code generator. If you wanted to attach testmenu2.php to another post, I could take a closer look.
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/
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] show category name at top filtered list page
By wizzle - April 2, 2009
Thanks. sorry it took a while to reply back... got busy.
Your code worked. I added to it to come up with
<?php if (@$_GET['category']=="") {echo "Test Menu";} else {echo @$_GET['category'];} ?>
so that when they click on "view all" or one of the letters, it will just say "Test Menu" in that place.
Thanks again.
Your code worked. I added to it to come up with
<?php if (@$_GET['category']=="") {echo "Test Menu";} else {echo @$_GET['category'];} ?>
so that when they click on "view all" or one of the letters, it will just say "Test Menu" in that place.
Thanks again.
Greg Williams