aleanos / webflow-scripts

Webflow scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebFlow Scripts

Webflow Scripts houses the kava labs scripts which populate data our to our webflow sites. These scripts need to be updated from time to time when want to add new or tweak existing metrics on the various webflow pages.

Each page in webflow has its own script. Scripts are named based on the page they support. IMPORTANT: Webflow scripts must remain under 10,000 characters. You will need to use a minifier if the length of the file is too long or host the files and reference them in the webflow script. We currently use: https://www.jsdelivr.com/ and reference the files

Updating the webflow page.

  • Find the project's webflow file in this repo.
  • Make changes to the file and run the functions locally so you can confirm they work. You can also use a tool like Playcode.io
  • Updating the script(s) on webflow
    1. Log into webflow
    2. Click the app you are updating
    3. In the upper left, click on the 'Pages' link
    4. Find your page, and click on the 'Settings' gear
    5. Navigate to the Custom Code section and look for the <script> tag
    6. Check against Staging
    7. Publish to Production

Old way to make updates

  • Find the project's webflow file in this repo.
  • Make changes to the file and run the functions locally so you can confirm they work. You can also use a tool like Playcode.io
  • Update the webflow page.
    • Log into webflow
    • Click the app you are updating
    • In the upper left, click on the 'Pages' link
    • Find your page, and click on the 'Settings' gear
    • Paste your minified (or under 10,000 character code between the <script> tags
    • Update the UI elements to use new script

Notes:

  • Some elements on the page are tied to the script via CSS id others are tied to the script via CSS classes.
  • If you copy a webflow item, it will clone the classes. Now when you edit the classes, it will edit them for the copied element as well. It is best to duplicate a class, and then change the name of it if you need similar styling, but a new class name.

About

Webflow scripts


Languages

Language:JavaScript 97.4%Language:CSS 2.6%