Hello,
I am very new to EB, and the extension I build is very simple, it doesn't have any javascript files, just <script>.
So there is a variable:
var my_str = "Hello, try it yourself";
In EB, how do I allow users to change "Hello, try it yourself" so the user can put whatever they wish?
Thanks.
Trying to build my first extension, but need help
-
-
- Posts: 398
- Joined: Sun May 15, 2011 10:27 am
Re: Trying to build my first extension, but need help
Hi,
Two things needed.....
[1] set the variable string in my_str between $ in the whatever section the variable needs to appear - so it will look like $my_str$
[2] In the Properties section you need to allow the user to specify the value of $my_str$. So add a category and then add a property. Enter a name for the property (which gets transcribed as the variable name - but you can edit that after), enter the other values, make the TYPE and edit field and you're done.
Two things needed.....
[1] set the variable string in my_str between $ in the whatever section the variable needs to appear - so it will look like $my_str$
[2] In the Properties section you need to allow the user to specify the value of $my_str$. So add a category and then add a property. Enter a name for the property (which gets transcribed as the variable name - but you can edit that after), enter the other values, make the TYPE and edit field and you're done.
-
-
- Posts: 398
- Joined: Sun May 15, 2011 10:27 am
Re: Trying to build my first extension, but need help
Thanks for the replyAdendum wrote:Hi,
Two things needed.....
[1] set the variable string in my_str between $ in the whatever section the variable needs to appear - so it will look like $my_str$
[2] In the Properties section you need to allow the user to specify the value of $my_str$. So add a category and then add a property. Enter a name for the property (which gets transcribed as the variable name - but you can edit that after), enter the other values, make the TYPE and edit field and you're done.
hmmm, that didn't work properly!!
Should it be like this:
var my_str = "$here$";
and in properties: Type: edit
Variable: $here$
?
Re: Trying to build my first extension, but need help
supersonictt,
Yes, sorry I didn't properly read the first post. As the code is actualy script the variable will have to go between " marks so where you want
var my_str = "Hello, try it yourself";
to be a variable you would replace it with
var my_str = "$my_variable$";
And you can have whatever name you want for that variable string - doesn't have to be my_var. When you specify the name in the properties you'll probably use something sensible and easy to understand, like Name of Country which will result in a variable name of $nameofcountry$ so your script code would then read
var my_str = "$nameofcountry$";
Yes, sorry I didn't properly read the first post. As the code is actualy script the variable will have to go between " marks so where you want
var my_str = "Hello, try it yourself";
to be a variable you would replace it with
var my_str = "$my_variable$";
And you can have whatever name you want for that variable string - doesn't have to be my_var. When you specify the name in the properties you'll probably use something sensible and easy to understand, like Name of Country which will result in a variable name of $nameofcountry$ so your script code would then read
var my_str = "$nameofcountry$";
-
-
- Posts: 398
- Joined: Sun May 15, 2011 10:27 am
Re: Trying to build my first extension, but need help
Yes, that worked that way
Initially, the extension works, but still, it has other variables which will need more testing... Plus, I could make it work when page loads as an event.
Would you like to have a look at it? Personally, I liked the script that's why am trying to make it as an extension for WWB users to use it.
Thanks a lot for your help
Initially, the extension works, but still, it has other variables which will need more testing... Plus, I could make it work when page loads as an event.
Would you like to have a look at it? Personally, I liked the script that's why am trying to make it as an extension for WWB users to use it.
Thanks a lot for your help
Re: Trying to build my first extension, but need help
Sure. As the PM system is disabled you will need to contact me via my web site. Email me from there so I get your email address and then you will be able to email me back with an attachment.
- BaconFries
-
- Posts: 5364
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Trying to build my first extension, but need help
@ supersonictt can I bring this to your attenion before building and sharing extensions. please ensure that you have permission to use the script, do not use scripts that you have scraped for another site HTML source code, please provide a link back to the original author of the script, check the copyright can it be distributed freely etc etc.... you can read more about the rules of this at the following
viewtopic.php?f=42&t=17899
viewtopic.php?f=42&t=17899
-
-
- Posts: 398
- Joined: Sun May 15, 2011 10:27 am
Re: Trying to build my first extension, but need help
@BaconFries
Thanks for pointing this out. I will do this for sure, and now, I am just trying things out with EB.
I will contact the developer of the script and ask him for permissions to use it
Thanks a lot for reminding me
Thanks for pointing this out. I will do this for sure, and now, I am just trying things out with EB.
I will contact the developer of the script and ask him for permissions to use it
Thanks a lot for reminding me