Kristoff Posted October 22, 2013 Share Posted October 22, 2013 Hi, hopefully this should be straight forward... When doing a search, the category title changes to: " Products found matching 'search'. " However if you do a search and nothing is found you simply get: " Search results " Is there any way of making the title "Search results" all the time as our category titles are a large font size and when the Products found matching 'search'. shows up it goes over 2 lines and ruins the theme. Cheers Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 22, 2013 Share Posted October 22, 2013 Hi Kristoff There are two things you can do or a mixture of both. 1. You can reduce the font size in the CSS files so that more fits in the line before falling onto the line below. 2. You can edit the skins/{skin in use}/templates/content.category.php to get it to automatically truncate the text. e.g. Change: <h2>{$category.cat_name}</h2> To: <h2>{$category.cat_name|truncate:30:"…"}}</h2> More information here. Hope that helps. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 22, 2013 Author Share Posted October 22, 2013 Thanks for this Al, however if possible i'd rather the title just be a standard title of " Search results " rather than changing dynamically for each search. There's nothing wrong with the title for any of the other categories, it's only when it adds the extra text and search phrase. From doing test searches and resulting in no items, i'd guess it's probably just a simple if else statement that returns the title as when there are no search results it simply says " Search results " ? EDIT: I have just tried the truncate method and it now has "Products found...", whilst this works, I'd really like this to say "Search results" if possible? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 22, 2013 Share Posted October 22, 2013 Ah I see. In that case just change: <h2>{$category.cat_name}</h2> To: <h2>{$LANG.navigation.search_results}</h2> Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 22, 2013 Author Share Posted October 22, 2013 Thanks again, problem with that is that it changes the title of the normal categories too. I basically want normal categories to display properly and then "Search results" when it's a search. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 22, 2013 Share Posted October 22, 2013 What skin are you using? For the Kurouto skin, the <h2> block at the top of /templates/content.category.php (seen at the top of the center column of the page) will grow as tall as it needs to be and does not cause problems for the rest of the page. If you want to change what is displayed to a simple "Search Results", you can try using CubeCart's Language phrase editor in admin. The phrase will be in the "catalogue" group, the "notify_product_search" phrase. Currently, in English, it says, "Products found matching '%s'." Change it to "Search Results". Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 22, 2013 Author Share Posted October 22, 2013 It's a custom skin i'm working on. The language trick has worked perfectly thank you! I did try and find it but was looking under category rather than catalogue. Many thanks Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 22, 2013 Share Posted October 22, 2013 Glad that worked for you, Kristoff. While this thread is open, however, I've always thought it would be better to show the search terms used in an unsuccessful search as well, so customers can see if they had a typo, etc. Since there's no reply here, I've created a new >thread with this new topic, where a solution has been offered. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.