This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Kasper Andersen
Posted May 05 - Read on Facebook

Hey

I have a new text question:
How do I "import" a text from a .txt/module. I want to have text.html = "sometext" where sometext is a long text outside of my Framer document.

I tried to make a module saying: exports.sometext = "it works!"
The result in framer is "undefined"

6 Comments

Chris Camargo

Re: that last sentence, how did you import your module?

Kasper Andersen

Chris Camargo module = require "myModule" - and the module is called myModule.coffee

Chris Camargo

Got it, then how did you access it from your prototype? Syntax specifically.

Kasper Andersen

textTitle.html = module.sometext

Chris Camargo

That's a bit of a head scratcher. If myModule.coffee is indeed in the module folder, that should work. Are you on the latest Framer Studio build, and have you tried restarting it? I sometimes have trouble getting it to refresh my latest module changes.

Kasper Andersen

oh my god.. It helped by restating Framer Studio.. Thanks!

Read the entire post on Facebook