0

I generated the buttons and downloaded a folder that has a .png image a .js file. Where do I put the code and image? I'm only familiar with html and css.

Our website is built on the modx platform. I can edit html and css on the pages.

larry909
  • 145
  • 8

1 Answers1

0

MODX Revolution (the latest version of MODX) tries not to tell you where to put things like images and css. Traditionally, javascript, css, images, and other front-end static resources go in the "assets" directory.

Edit: I just noticed that your script is share42 and have modified the answer accordingly:

Let's say you unzipped the directory and uploaded it into the assets directory. The file structure in a traditional install would be as follows:

  • assets
    • components (used by MODX extras to store their js, css, etc...)
    • share42
      • icons.png
      • share42.js
  • connectors
  • core
  • manager

Then, paste the following code in the appropriate place in a MODX template or chunk:

<div class="share42init"></div>
<script type="text/javascript" src="[[++site_url]]assets/share42/share42.js"></script>

This should work in a properly-set-up MODX installation, because [[++site_url]] should resolve to the URL of your MODX installation.

Tip: If you are likely to relocate or rename your assets directory, you might want to use [[++site_url]][[++assets_url]]share42/share42.js as the script URL isntead.

Oleg
  • 1,659
  • 13
  • 23