Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Posts
    402
    Plugin Contributions
    0

    Default Search term in search results title

    When you search, the title of the search results says "Advanced Search" and the breadcrumbs trail is "Home > Advanced Search > Search Results" but is there a way to make the term you searched for the title and breadcrumbs to be "Home > Advanced Search > Term You Searched For"?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Search term in search results title

    A couple small changes:

    1. /includes/modules/metatags.php
    insert the 3 lines as shown:
    Code:
      case 'advanced_search_result':
      define('META_TAG_TITLE', NAVBAR_TITLE_2 . ' -> ' . zen_output_string_protected($keywords) . ' ' . PRIMARY_SECTION . TITLE . TAGLINE);
      define('META_TAG_DESCRIPTION', '');
      define('META_TAG_KEYWORDS', '');
      break;
      case 'password_forgotten':
    2. /includes/modules/pages/advanced_search_result/header_php.php
    near the bottom of the file, add this line, as shown:
    Code:
    $breadcrumb->add(NAVBAR_TITLE_2);
    $breadcrumb->add(zen_output_string_protected($keywords));
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2008
    Posts
    402
    Plugin Contributions
    0

    Default Re: Search term in search results title

    Awesome, thank you so much! I also needed to make the search result show in the page heading, so I did an ugly hack because I don't know how to do it the right way:

    in tpl_advanced_search_result_default.php changed:
    <h1 id="advSearchResultsDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
    to
    <h1 id="advSearchResultsDefaultHeading"><?php echo META_TAG_TITLE; ?></h1>

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Search term in search results title

    That's one way ... or:
    Code:
    <h1 id="advSearchResultsDefaultHeading"><?php echo zen_output_string_protected($keywords); ?></h1>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Search term in search results title

    BTW, the code from post #2 above is scheduled to be included in the upcoming v155 release: https://github.com/zencart/zencart/pull/819
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    May 2008
    Posts
    402
    Plugin Contributions
    0

    Default Re: Search term in search results title

    Quote Originally Posted by DrByte View Post
    That's one way ... or:
    Code:
    <h1 id="advSearchResultsDefaultHeading"><?php echo zen_output_string_protected($keywords); ?></h1>
    PERFECT!!! Thank you for this, for everything you've helped me with in the past, and for anything in the future that you kindly help with!

 

 

Similar Threads

  1. Replies: 4
    Last Post: 19 Mar 2016, 04:54 AM
  2. Search results in title
    By wirefram in forum General Questions
    Replies: 0
    Last Post: 15 Aug 2011, 08:27 PM
  3. List title matches in search results first.
    By donhohler in forum General Questions
    Replies: 0
    Last Post: 2 Jan 2011, 04:57 AM
  4. Category Title in Search Results
    By Ramses65 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 20 Dec 2010, 08:57 PM
  5. Replies: 8
    Last Post: 5 Dec 2006, 10:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR