sivaprasad9394
Occasional Collector

Is there any possible way to set js variable to FS variable?

Jump to solution

Hello,

Is there any possible way to set Java script variable to cms_set?

javascript variable value:

var metaTitle = Zentrale Telefon-Ansage an Mariä Himmelfahrt;

How to set the value to CMS tags assignment.???CMS_SET

Thanks

0 Kudos
1 Solution

Accepted Solutions
pavone
I'm new here

Hello,

I'm not sure what exactly you're trying to do. Do you want to

1. assign the value of a FirstSpirit variable to a JavaScript variable?

Or do you try to

2. assign the value of a JavaScript variable to a FirstSpirit variable?

The first can simply be done by something like:

$CMS_SET(set_fsVar, "myValue")$

<script>

     var jsVar = "$CMS_VALUE(set_fsVar)$";

</script>

The second on the other hand is not possible since the generation of your site has already finished when your JavaScript code is executed.

I hope this will help.

Best regards

Tim

View solution in original post

0 Kudos
2 Replies
pavone
I'm new here

Hello,

I'm not sure what exactly you're trying to do. Do you want to

1. assign the value of a FirstSpirit variable to a JavaScript variable?

Or do you try to

2. assign the value of a JavaScript variable to a FirstSpirit variable?

The first can simply be done by something like:

$CMS_SET(set_fsVar, "myValue")$

<script>

     var jsVar = "$CMS_VALUE(set_fsVar)$";

</script>

The second on the other hand is not possible since the generation of your site has already finished when your JavaScript code is executed.

I hope this will help.

Best regards

Tim

0 Kudos

Hello Mr. Tim Gremplewski,

Thanks for your kind reply.ya it is not possible.

0 Kudos