Jump to content

Tip Tip Important TIP


Guest sunshine

Recommended Posts

Guest SDRJ

Hold on, i'm not sure i understand what you guys are talking about. Are you suggesting that you would rename the Classic skin to Classic_bla, and then rename Killer to Classic? Why? You're content should never depend on a specific skin name.

If you're using a skin name such as Classic in your template files, you should instead make sure the following line is defined in the PHP include file, and if its not defined then add it:

$view_cart->assign("VAL_SKIN",$config['skinDir']);

And then use {VAL_SKIN} in your template files, rather than Classic etc.

Apologies for 'bumping' this old topic but just like to say thankyou for that tip

although wonder why this is not added to the files in first place .. am using latest version (3.0.16) and have had to add this to all the inc files, would this not be better if when coded it was added in first place to save us adding it to all the inc files

Link to comment
Share on other sites

:D

Well, this topic never mademuch sense, but alot of the comments did - like that one :(

And that topic (using uri's in other template files besides global) is also a very old one. I know the suggestion was made that CubeCart come stock with those assignments at least as far back as 3.0.4, but it never caught the developer's imagination.

Link to comment
Share on other sites

I've done this from day 1 and I think what the tip was about was that in doing so, when you upgrade your site, you don't lose the modifications you made since your site skins are no longer the default names - Classic_mc in my case always remains constant after upgrades and I just use the file of what has changed to see if there were any modifications to the skins in the update and make them manually.

At least I think is is what this thread was suppossed to be about :)

Link to comment
Share on other sites

Guest SDRJ

reason i found useful is that I am using an image for each of the 'block' titles instead of just text on a background image so instead of using the default way

<div class="boxTitleLeft">{LANG_LANGUAGE_TITLE}</div>


I use


<div><img src="skins/{VAL_SKIN}/styleImages/backgrounds/language.png" width="180" alt="Language" /></div>

but obvioulsy for that to work I have to add {VAL_SKIN} to the inc templates for my images to work, whereas if that had been added when CC was being written then it would save a bit of work (but perhaps I am being lazy ... lol)

Link to comment
Share on other sites

Guest offthehook

reason i found useful is that I am using an image for each of the 'block' titles instead of just text on a background image so instead of using the default way

<div class="boxTitleLeft">{LANG_LANGUAGE_TITLE}</div>


I use


<div><img src="skins/{VAL_SKIN}/styleImages/backgrounds/language.png" width="180" alt="Language" /></div>

but obvioulsy for that to work I have to add {VAL_SKIN} to the inc templates for my images to work, whereas if that had been added when CC was being written then it would save a bit of work (but perhaps I am being lazy ... lol)

Wouldn't it just be easier to put all your custom images into an 'images' folder at the root of the store. That way no matter what skin you use the path would always be correct.

Link to comment
Share on other sites

LOL, that's the beauty of it. Well, there are many ways to skin a cat. I often add {SKIN} to a template or other unless I am too lazy and hard code something, which is never a good idea in case customer changes the skin folder name.

@ misty, this is a vey, very old thread. I came to realize a couple weeks after sunshine wrote it that she was saying that no matter what skin you use, always keep the same skin name, because in her opinion it mattered to SEO indexing. That is not the case.

BUT, since this thread seems to often spur discussion about other things, like giving your skins a name of their own before hacking the original code, it's a good thing :blink: Several of us have been preaching that from the start, it just makes sense. I have to confess I cringe a little when I see a fully custom skin and find that it is named Classic, Killer or Legend, ROFLMAO. Does "cringing" at something like that make me a geek? :cry:

Link to comment
Share on other sites

Guest offthehook

i understand what you are saying but in this case not really .. different images required for different skins

Then try this directory structure for images:

www.yourstore.com/images/skin1

www.yourstore.com/images/skin2

www.yourstore.com/images/skin3

Making changes to the includes files means that you'll have to track your changes when upgrading your store, and to be fair you really don't need that hassle.

In fact I don't understand why you can't just leave the images inside the relevant skin folder seeing as different images are going to be called by different skins. The hard coding of the image paths will be in the tpl files so each skin will have a different tpl file.

Link to comment
Share on other sites

@offthehook, sorry mate, there is no right or wrong answer.

As to hard-coding image paths, it is fine if you are making only one-off skins for yourself and others, but if you ever offer skins publicly, free or commercial, it is bad form. It takes away the ease with which a user may rename the skin file, and thus mars a bit of the beauty of the CubeCart coding method.

As to editing core php files, this is a practical necessity in MOST cases, as MOST serious web stores will diverge from the out-of-box features of the cart. If you truly intend to change only skin files, that is ffine, but most of us will mod stores quite heavily where the core files are concerned and deal with upgrades by use of file compare programs where necessarry. Not such a problem, really.

And it is quite possible that a person might code a variety skins that use similar format - like images in many template files, that bear the same names across skins but actuall have different appearances, etc. Basically, I'm writing in hope that you might be able to see that folk can have many reasons for taking certain approaches, and your method will not be pat for everyone. B)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...