Jump to content

Archived

This topic is now archived and is closed to further replies.

Izraelviz

- Solved - Adding JS/CSS files to "Documents"

Recommended Posts

Hi,

I am seriously concidering changing our e-commerce platform from PrestaShop to either CubeCart or OpenCart. I have been playing around with CubeCart, and so far I think I like it. The back-office is pretty straigth forward and to the point, which I like. However it need to tick some boxes before setting sail on this swap project, so I was wondering if there is an easy way to add JS and CSS files to the "Documents" section of cubecart? It it the "main.php" in the skin folder i need to add the info, or is there another more suitable place? 

 

Thanx in advance

 

/ Elviz

Share this post


Link to post
Share on other sites

When you say the "Documents" section, are you referring to:

* admin, Documents: the screens where you compose/edit the site's documents
* the actual document content: that is, <script> and <style> inline tags
* the storefront area that lists the documents available
* the storefront main area that displays a site document

For each, yes, javascript and CSS can be easily applied. Each will take a common procedure but use different parameters for each procedure.

 

Share this post


Link to post
Share on other sites

Sorry late reply, bsmither. Thank you for answering though. Hopefully I will get some time to play around with this now =) 

I would like to create a new "cms" page with some js accordion.

I will need to reproduce, one way or another, the page we now got in our active store (wich is pretty slow and outdated, unfortunately. Hence the future migration)

http://norwegianrat.no/en/content/4-music

Thanx in advance,

Elviz

Share this post


Link to post
Share on other sites

Eventually I figured it out. Since I can't stand finding threads where they say they found a solution to the problem without posting the procedure, I'll add what i did, incase it could be of help to others.

Short version:

Basically I just added the css and js files to the theme and added the link in the main.php

Long version:

01.Download and edit main.php from your theme/skin folder. I.E yourdomain.com/skins/foundation/templates/main.php

02. Add the css link(s) with the other links (at the top) I.E: <link href="{$STORE_URL}/skins/{$SKIN_FOLDER}/css/yourcss.css" rel="stylesheet">

03. Add the ja link(s) with the other links (at the bottm) I.E: <script src="{$STORE_URL}/skins/{$SKIN_FOLDER}/js/vendor/yourjs.js" type="text/javascript"></script>

04. Upload the actual css and js files to the folders

05. Go to your backoffice, enter the "Pages" section. Find/Create the page you want your code in. Switch to code mode (upper left option of the text editor) and enter the html code. I.E:

<div class="test-container">
<h1 class="heading-primary">Animated Accordion</h1><div class="accordion">
<dl>
    <dt><a aria-controls="accordion1" aria-expanded="false" class="accordion-title accordionTitle js-accordionTrigger" href="#accordion1">Header Text Here</a></dt>
    <dd aria-hidden="true" class="accordion-content accordionItem is-collapsed" id="accordion1">
    <p>Lorem ipsum dolor sit amet, consectetur.</p>
    </dd>
</dl>
</div>
</div>

06. Save and enter page to check if it works.

 

In my case I had to add the actual js code to the bottom. Linking to it did not work. Not sure why.

 

If this procedure is a rather dirty one, and there is a cleaner way to to this, feel free to add the info. I pretty much operate within the "shot in the dark"-philosophy. =)

Regards,

 

Elviz

Share this post


Link to post
Share on other sites

If anyone can suggest a neater way to accomplish it, Bsmither would be the one to do it. Congrats on coming up with a solution. I do know that there are times when it is suggested that code be added within literal tags. Maybe that's why you had an issue with the button???

Share this post


Link to post
Share on other sites

A little typo there. Ment "Bottom" Bottom of the main.php with the rest of the js scripts. Yeah I can't quite seem to find out what is going on. Right now it looks like I need both the script itself PLUS the link to file containing the same script, and I might not know so much about these things, but this does not make sense to me, as one source in most occasions should be enough =D 

Share this post


Link to post
Share on other sites

Can you use Firebug or something similar to watch the waterfall? It might help you tell what is actually being done in what order.

Share this post


Link to post
Share on other sites

I might have to do that yes. It needs to wait a little now though, as I'm working on ironing out all the other checkboxes that needs to be ticked before concidering moving from PrestaShop. Right now the language settings is killing me. Can't seem to get Norwegian up and running....

Share this post


Link to post
Share on other sites

×
×
  • Create New...