| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Custom Graphic titles for only SOME of the categories. | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Custom Graphic titles for only SOME of the categories.
Since I have gotten so much good advice from this forum, I decided to pass along a little trick that may be useful to someone else.
This will allow you to add custom titles for certain sections, but if the file does not exist, it simply displays the HTML text as usual. Lets say that you have a few root categories and a lot of sub-categories. The root categories you would like to have a custome "graphic" title for when you go into that category but you dont really need them for all the 100+ sub categories that you might have. In other words, your main categories are, say, "Saws", "Drills", and "Wrenches" and you want some fancy graphic to display as the dialog title for these categories and maybe for the Help, Shipping and other sections, but not for any of the others. This is a solution that will allow you to make a custom header for any area of the site based on the $title variable that is passed to dialog.tpl. ------------------------- First, you have to make a new plugin for Smarty. Create a new file in the Smarty-2.5.0/plugins folder named function.file_exists.php. The contents of this file are: Code:
Next, change the code in the dialog.tpl file to: Code:
Now, make a new directory in your skin1/images directory named headers. This is to house all the new graphics for the dialog headers and keep them seperate from your other graphics. To use this just make a new header graphics for what ever section that you want, name it the exact name of the section (eg. Help zone.gif, Privacy statement.gif, Terms & Conditions.gif, FAQ.gif, Saws...), whatever name is used for the $title variable, and copy it to the new skin1/images/headers directory. Take care to examine the file name for the graphic after you FTP it over. You may need to replace some "_" characters with spaces, as FTP transfer will sometimes replace spaces in filename with "_". Also, make sure the capitolization is EXACTLY like it is in the variable. The best thing about this is that it will allow the graphic titles but you do not have to create them for the entire Admin section either. If the graphic does not exist, it just displays text as usual. I hope all this makes sense.... {* This is for Verison 3.4.x - I have not tried it on older versions *} |
|||||||||
#2
|
|||||||||
|
|||||||||
This is great. Thank you for sharing it.
Maybe we should ask them mods to move this to "Custom Templates". |
|||||||||
#3
|
|||||||||
|
|||||||||
done
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#4
|
|||||||
|
|||||||
Problems...
I tried it myself, only in another variation... Instead of using it on the categories, I tried using it on the subcategories (subcategories.tpl). I succeeded in making it work manually (by inputting a whole specific file name), but when I tried to make it work automatically it still showed me the subcategories as text. After analyzing it bit by bit, I came to the conclusion that it doesn't even check if the file exists. To make my point stronger, I deleted the file "function.file_exists.php" from the plugins directory and I didn't get any error (although the template had the reference to that function). This probably means, the template doesn't refer to the right file. Anyway, here's my code, hope that anyone can help: Code:
Thanks, Dan. |
|||||||
#5
|
|||||||||
|
|||||||||
Nice!!!
Works Great!!!
|
|||||||||
|
|||
X-Cart forums © 2001-2020
|