Problems, need help? Have a tip or advice? Post it here.
20 posts Page 1 of 2
Hi there,

i hope this has not been discussed before - i could not find anything related (sorry if i missed something).

I started working with Couch CMS today and everything worked like a charm until i uploaded .html files generated from Adobe's Edge Animate software. I figured that lines of text that i wanted to make editable are written in the .js file that Edge Animate rendered.

I'm wondering if there is an easy way of "injecting" the text into the .js file using Couch? I guess changing .js to .php will not work?

Any help is greatly appreciated - thanks in advance!

Sundance
Hello and welcome, Sundance :)

One way of injecting editable text into JS code would be to move that JS code inline into Couch managed PHP templates. This way the code is simply a part of the PHP file and nothing special would be required to manipulate it.

Another way (and this is what I suppose you were looking for) is to make the JS file itself Couch managed. To do so the regular drill has to be followed i.e. extension needs to be changed to PHP and the two mandatory lines of PHP need to be added to it. Additionally, you'll also need to add the line hilighted below right below the include statement -
<?php require_once( 'couch/cms.php' ); ?>
<cms:content_type 'application/javascript' />

With that now you can make the JS file turned into a PHP template serve JS code.
<script src="http://www.yoursite.com/somefile.php" type="text/javascript"></script>

The same process also applies to CSS files. You can find a discussion about it here -
viewtopic.php?f=2&t=7406

Hope this helps.
KK wrote: With that now you can make the JS file turned into a PHP template serve JS code.
<script src="http://www.yoursite.com/somefile.php" type="text/javascript"></script>



Hello KK, thanks for the warm welcome and your kind help!

Turning the js File into a php file and adding the lines of code was not a problem. But i'm struggling to find the right spot to add the <script src>. I only have the main "index.php" file, which contains the Edge Animate data. Do i call it with the other scripts or replace code?

This is what the head of the index.php currently looks like:

Code: Select all
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
   <title>Untitled</title>
<!--Adobe Edge Runtime-->
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <script type="text/javascript" charset="utf-8" src="http://animate.adobe.com/runtime/5.0.1/edge.5.0.1.min.js"></script>
    <style>
        .edgeLoad-EDGE-287806272 { visibility:hidden; }
    </style>
<script>
   AdobeEdge.loadComposition('sportpark-info', 'EDGE-287806272', {});
</script>
<!--Adobe Edge Runtime End-->

</head>


Thanks again! :)

Sundance
Your original post states -
I figured that lines of text that i wanted to make editable are written in the .js file that Edge Animate rendered

Let us take Couch out of the equation for a moment. The JS file you mentioned above surely must be included in the original static design somewhere? I also assume this is the file that you turned into a Couch template. So now you just need to update the name and path in the original code.

Or am I missing some part of the puzzle?
I'm afraid this is something i will have to ask in an Edge Animate forum..

I only have the .js file (which is now a php file) and the original .html file (which is now a php file as well) - the head section i pasted above is where i would expect the .js file to be included, which it isn't in the original file. In fact, the original file name of the js file is nowhere to be found in the code..

I guess the software has some special way of rendering and calling the different functions. :|


EDIT: I tried to include the js php file in the head section with the line you suggested, but it doesn't work yet..
Yes, I think Edge Animate only can provide a definitive answer.
I suspect, however, that their code would be expecting a JS file of a particular name at a particular path. Changing that file's name and location, as we did, likely won't work.

Please ask them if this is possible.
Yes, i already posted in their support forum - i hope there is a fairly easy way to achieve this. I want to stay away from code as far as possible - that's why i came here :D

Thanks for you help KK! :)


By the way - i opened the runtime file that is included in the head section and found this bit of code (i searched _edge.js - the original js file's name):

Code: Select all
a&&(c&&c.bootstrapLoading?
ia.push(a):window.edge_authoring_mode&&c.sym?f.load(a+"_edge.js?symbol="+c.sym):f.load(a+"_edge.js"))):window.edge_authoring_mode||


Could this be part of the problem? It looks like it just adds "_edge.js" to the variable "a"..

This is way over my head though, i've never even touched runtime files before..

Thanks again, your help is much appreciated! :)
That really is something vendor specific and I have no experience with Edge Animate, I'm afraid.

Going by what you posted, the code does seem to be loading the '_edge.js' file.
Is your PHP version at the same location where the original '_edge.js' was? If so, you can try putting in the new name in the code. Else you'll also need to tweak the path.

Again, not sure if it'll work though as it all depends on their code.
I will wait for the reply in the Edge Animate forum.. maybe they have an elegant solution for my problem.

I will reply here as soon as i know more - maybe the information will be useful for other people!

Thank you
So - since nobody replied in the Edge Animate forum yet, i've tried some things myself (i can be very impatient :D)

Actually, changing the line from the runtime from a+"_edge.js" to a+"_edge.php" does the trick. I just had to upload the changed runtime file to the ftp folder and relink it in the include section.

The only thing that does not work now is clicking "view" right off the Couch panel - it then opens the js/php file as text in the browser. But that is not really a problem, as i review the page in a seperate browser tab. I just have to explain this to the customer! :)

Thanks for your help - i'm glad it works now!
20 posts Page 1 of 2