Let’s see what we have here

By | July 28, 2008

“Let’s see what we have here” – a piece of text that shows as the title in each of your category pages. Absolutely useless! You should change this to something more interesting and useful (in terms of user experience and SEO) such as the title of the category – doing this is very simple…

Open up /includes/languages/english/index.php and find:

[php]define(‘HEADING_TITLE’, ‘Let\’s See What We Have Here’);[/php]

Change to:

[php]define(‘HEADING_TITLE’, $categories[‘categories_name’]);[/php]

Save and upload. Done.

There is a slight problem once you’ve done this, but I’ll cover that in a future post – inthe meantime I wonder if any of you can work out what the problem is? The first person to spot the problem and present a solution will win a prize…

Answer to Problem:

[php]$category_name = (isset($HTTP_GET_VARS[‘manufacturers_id’])) ? $manufacturers[‘manufacturers_name’] : $categories[‘categories_name’];
define(‘HEADING_TITLE’, $category_name);[/php]

manufacturers are now called as appropriate.

18 thoughts on “Let’s see what we have here

  1. cassie

    Have no idea what the problem is. Love this idea tho.
    Pretty cool.

    Only thing I can really see and it most likely is meant to be that way is that until you get to the sub-Categories (if using) Is you get the word Categories there. Would be even cooler if say the Main Category name was there instead.

  2. jared

    define(‘HEADING_TITLE’, ucwords(strtolower($categories[\’categories_name\’])));

  3. jared

    That line of code wouldn’t be terribly helpful on the main index page anyway. No categories have been selected.

  4. Gary Post author

    Cassie – in that case, just also change this line 😉

    define(‘HEADING_TITLE’, ‘Categories’);

    Jared – good try, but it should work OK without the ‘ escapes.

  5. John

    I believe it’s the problem is that the language file is called before the $categories query is run.

  6. John

    Forgive the bad grammer in the previous post. Just starting the day off a long night. 🙂

  7. Gary Post author

    John – that shouldn’t affect it.

    The problem is the “manufacturers” name – it simply will not show as we are only asking the script to show the category name.

    Most shops probably would never notice it – but if your shop does use Manufacturers, and you made this modification, then you need a bit of extra code to deal with it.

    Anyone come up with the extra bit of code?

  8. cassie

    You are a legend Gary 🙂
    Thanks for that tip.

  9. Gary Post author

    BCS – I’m guessing you added code which wordpress managed to eat. If you send it me via email I’ll add it to your comment.

    Cheers.

  10. Gary Post author

    Oh – no-one took up the challenge, so here you are:

    $category_name = (isset($HTTP_GET_VARS[‘manufacturers_id’])) ? $manufacturers[‘manufacturers_name’] : $categories[‘categories_name’];
    define(‘HEADING_TITLE’, $category_name);

    This will show the manufacturers name instead of the category nam when in the manufacturer structure of index.php

  11. Bean Coffee Shop

    I guess it did eat it. It was the EXACT code you added but mine got eaten … 😉 So where is my prize???

    Okay, all I put was that you needed the H1 tags around the code that displays it on the page which would make is better in terms of SEO.

  12. Gary Post author

    WordPress is ultra annoying when commenting code – reckon this is what you wanted:

    <h1><?php echo HEADING_TITLE; ?></h1>

    in your index page?

    I agree that this would be much more suitable for SEO purposes – ally that to the changes made in the original post and my follow up comment and we have something that is more useful for every store.

    My next addition would be to code up my own flavour of “Category/Manufacturer Descriptions” and print that in the index structure too. Thoughts? I know there is already some contributions for this, but I like coding my own where possible.

  13. Bean Coffee Shop

    Sorry Gary, for SEO that should have been an h2 tag as there is a better place for the h1 tag and it is a good little trick. I sent you an email with where the h1 tag should go. It should be higher on the page.

  14. John Hoff

    Thanks Gary. I’m designing a site for my wife’s business and couldn’t for the life of me figure out how to remove this dumb line LOL. I really appreciate the help and tutorial.

  15. Benny

    Gary,

    I ran into your post when I was trying to remove “what do we have here”, I have modify the the code in the index page catalog/includes/languages/english/index.php according to what you have and it still have not change anything. I also did it in the admin/tools/definepages and still nothing change.

    Can you tell what the problem is? I mean I hard code the page in an editior and did it via the admin.

    Please help,

    Benny Tran

  16. Gary Post author

    Benny – first up, rename your admin folder to something completely random, and change the /includes/configure file to match. Do that NOW.

    For your question, it is possible that the template/theme that you are using is not using the language file as it should be – you see this a lot with theme providers. Not a lot more can be said, as you probably require 1 on 1 help to get the theme working properly.

Leave a Reply

Your email address will not be published.