![]() |
Change the Featured Products Title Only?
Does anyone know if there is a way to change the title "Featured Products" to a different font and color without affecting the other products' fonts and colors?
|
I would think you could just copy the .tpl file that is used for it then rename the copy you would then need to edit the featured products.php file I would guess and tell it to instead of pulling the old .tpl file to grab the new one. On you rnew tpl file you would hard code those parts instead of using css. I am not sure but if I was doing it I would start with looking into it this way. Anyone else know?
|
I would just create a new style in the style sheet for featured products (example NewDialogTitle) and have it reference that class instead by editing the dialog.tpl and in this line:
Code:
<TD height=15 class=DialogTitle background="{$ImagesDir}/dialog_bg_n.gif" valign=bottom>{$title}</TD> Edit it to have something like: Code:
<TD height=15 {if $title eq $lng.lbl_featured_products } class=NewDialogTitle {else} class=DialogTitle {/if} background="{$ImagesDir}/dialog_bg_n.gif" valign=bottom>{$title}</TD> This is NOT tested, so I'm not sure if it will work, but it should be a start and keep you from hard coding anything. :) Backup first! ;) Carrie |
I don't know enough at this point about php to be able to test it out. I'm still very new to x-cart. If someone else has free time and wants to test it out, that would be great. Thanks for the tip though Carrie. :)
|
I tested it out, it works. Just add a new line like this in the CSS:
Code:
.NewDialogTitle { And change the style properties above to what ever you want and use the code above in skin1/dialog.tpl It's all smarty, no php involved in this change. :) Carrie |
Thanks Carrie! I entered this into the dialog tpl, but it's not working on my side. I probably did something wrong:
Code:
{* $Id: dialog.tpl,v 1.15 2003/11/14 07:28:30 svowl Exp $ *} here is a cutout from my skin1css: Code:
} I put spaces in between the code so that I could find it easier. Did I do something wrong here? Thanks a lot for your help. |
Try taking out the *} after:
dialog_bg_n.gif" See if that helps. Carrie |
Thanks. I tried that out....forgot I had that there. But it still didn't work after I took it out. wonder why it doesn't work?
|
Are you getting any errors? What version of X-cart?
Carrie |
No, I'm not getting any errors...it's just basically ignoring the changes it seems like and still uses the default setup. I will play around a little more with it tonight. Thanks Carrie.
|
Hi again Carrie, I had some more time to try and play around with it, but i couldn't get it to work. I am using version 3.58. Any other suggestions? Thanks
|
Post your updated code again. I tried this in I think 3.5.5 (maybe 6).
Silly question, but you are replacing the dialog.tpl and skin1.css in skin1 directory, not in skin1_original, right? ;) Carrie |
templates_c
The old version is probably still in the templates_c directory. Delete everything in there.
When I'm developing I always go in to to Smarty.Class.PHP and set "var $force_compile = true;" which forces the templates_c directory to be rebuilt every time. |
Hi Carrie, that is a good question...I feel like an idiot since I'm not sure what the difference is. lol But I think i'm replacing them in the right directories. They are the ones that appear immediately in front of me when I click on "Edit Templates" within the Admin section. Hope that makes sense.
Here is the updated code for my dialog.tpl Code:
{* $Id: dialog.tpl,v 1.15 2003/11/14 07:28:30 svowl Exp $ *} Here is a section of the skin1.css Code:
.CategoriesList { |
You must be missing something simple because I copied and pasted the code you gave me into my stuff and it works on my end. And you editing them directly in the Admin should be changing the correct files.
Have you tried clearing your template cache? You can do this on the summary page in the Admin side of the store. Also make sure this lable still exists in your languages area: lbl_featured_products Carrie |
I checked and the lbl_featured_products does exist. I haven't tried clearing the template cache yet...I will try that. Is there any harm in doing so and will I lose any necessary data? Thanks again!
|
I don't think there is any harm. They just will have to recompile again upon the next view. It's just to help speed up viewing of X-cart.
I usually don't have to do that when I change things around, but some claim they do. Carrie |
Post, or PM me your store address if that doesn't work and maybe I can see what's wrong.
Carrie |
I cleared the Cache, but still nothing. I just sent you a pm. 8)
|
I looked at your site....Let me see featured.tpl now
Please.. :D Carrie |
Here is the Featured.tpl
Code:
{* $Id: featured.tpl,v 1.14 2003/02/07 11:35:04 svowl Exp $ *} |
Ahhh! As I expected. :)
What happened, is you put "Super Deals!" hard coded in the featured.tpl You should have left it $lng.lbl_featured_products and just changed the value of lbl_featured_products in your admin area under languages. Does this make sense? Then you don't have to change featured.tpl to change "Super Deals!" to something else. Carrie |
That makes sense. The only thing is that I couldn't change the value of l_featured_products anymore in the admin area under languages because I clicked on the Compile Templates box so that the only language I would have was English. Since I did that I don't have access to changing things in the languages area. Think I should click "restore file" under the templates edit section for featured.tpl, and replace it with the default or is there something else I can do? Just let me know what I can do to get it working...Thanks a lot Carrie! :)
|
OH. Hum. I've never done that before.
What you can do instead then, is in the if have this: Code:
{if $title eq "Super Deals!" } class=NewDialogTitle {else} class=DialogTitle {/if} That should work too I think. I don't know if you have to recompile the templates after changing them though with the way you have it set up. Carrie |
OOOOOHHH, there we go! I see what you were saying now! I Restored the file back to the old, and I see how it hard coded the "Super Deals" into featured.tpl. Works awesome now! What can I say, except thanks, once again Carrie! You really know what you are doing!! :D Thanks for being so patient too!
One last question...how would I change the font for the "Super Deals" to Impact font? |
You NEVER EVER EVER want to compile the templates. EVER.
I wish X-Cart would remove that altogether. What it does is go through all of your templates and replace the language variables with the current database values. Making label and text modifications to your site a bloody nightmare. If your store was very very static and you had finished buidling it (happy with everything) then I suppose you could compile the templates for a small speed boost, but no large dynamic site would ever do this and that would be the type of site most likely to benefit from this process. |
Unfortunately I did it quite a while back...I was thinking I can click on "Restore file" for many of the .tpl's that were changed during this process since there is no other way to reverse this, is there?
|
You will lose most if not all of your template modifications.
|
Yeah, I was thinking the only thing I could do since I didn't make a huge amount of changes just yet is go through many of the .tpl's that include text or labels that I might want to edit in the future and restore them. I can leave the ones that I know I have edited alone. I'm thinking this is better at least then completely reinstalling x-cart again. What do you think? I know it will be time consuming going through each one, but I can hopefully just restore the ones I think I willl want to use "languages" for later.
|
It's your call buddy.
Make sure you backup regularly when you are developing so you can go back and undo stuff like this. Backing up your templates is so, so important and often overlooked when people back up before modifying their store. Best of luck. |
Thanks for the tip Adpboss...I guess I'm pretty glad that I still haven't made a ton of changes to the templates and can still go back and restore many of them. So clicking on "Restore file" will bring it back to the same condition as if I never chose to "compile" them right?
|
I'm not 100% on that.
I do most things in the store manually, I've been using it for a long time (relatively speaking). Backup all your template files via ftp BEFORE you try that restore option. |
Well, I ended up doing a "restore all" from the main page of the edit templates, and it restored EVERYTHING. I'm glad you told me before I made too many changes because I was able to save the templates I had changed and just redo them after the Restore. So thankfully, everything is back to normal and I can now use languages to make text and label changes, and also I was able to still save and use the changes that Carrie helped me out with. Thanks everyone. Hope this is informative for others too.
|
Glad you got it all figured out! I actually didn't even know you could compile the templates until you said something about it. Sounds like it should come with a warning sign!! 8O
Carrie |
All times are GMT -8. The time now is 03:28 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.