Page 1 of 3

[?]Module allows to add JS scripts similar cms_stylesheet...

Posted: Fri May 17, 2013 6:25 pm
by requish
Hi.

Im looking for module... is there exist module allows to add JS scripts, edit and manage them, and works similar like tag cms_stylesheet which allow add css?

Adding external files by ftp too much time taken to make simple changes.

So, please help to find similar module. ???

Ah, I have CMSMS 1.11.4.

Cheers
req.

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Fri May 17, 2013 6:31 pm
by Dr.CSS
I use CMSMS file manager for all my JS uploads, drag/drop has made it very nice and easy, if you need to make changes, keep the file manager upload open in one tab, page it is on in another tab, then you can see it in action and if it isn't correct open JS in your editor make changes drag/drop, refresh page viola!...

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Fri May 17, 2013 6:39 pm
by requish
Hi

Thanks for fast reply! :)

Pretty OK solution. I forgot about this possibility.

However... Do You think it is good proposition to make some module to manage js files like at css we have?

...maybe exist some one that but I cant find it out...

Cheers
req.

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Fri May 17, 2013 7:48 pm
by Rolf
What about a Global Content Block?

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Fri May 17, 2013 8:24 pm
by requish
And this is can make external file (like css) ? How?

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 6:17 am
by Rolf
requish wrote:And this is can make external file (like css) ? How?
ohw. No that can't... Thought you only needed an editor in cmsms.

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 7:44 am
by requish
Yeah... Im lookin for module/addon which works exactly like {cms_stylesheet} but outputting file with ext .js . ;)

Im wondering why somebody didnt created some tag, like that about css, into core CMSMS... ::)

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 7:54 am
by applejack
Use a coding editor such as BBEdit on a Mac which has built in (S)FTP so you are editing the files directly on the server rather than having to save and then upload. If you want to store in the database via a GCB or stylesheet you can use the Template externalizer module.

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 9:04 am
by requish
Hi.

Thanks for reply. Hmmm:

1.I dont have a Mac ;) However some times I use Notepad++ with FTP connector (if i have access to ftp) and then I can live upload changes. It's a little bit OK.

2.BUT some times I cant enter to ftp (secure subject of clients). And then I cant use any softs/addons which allow enter on ftp...

3.Best for me is edit/build page only by one tool (I mean in this case CMSMS).

At now I have event like at point 2. Access only by CMS Admin...

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 10:07 am
by velden
what about:

- making a new template names 'javascript' that contains only

Code: Select all

{content}
Create a new content page, connect the 'javascript' template, hide it from menu, disable wysiwyg editor for the page.

Type your JS in content area.

Then, in template where you want to include JS:

Code: Select all

<__script__ type="text/javascript" src="{cms_selflink href='alias-of-page'}"></__script>
where 'alias-of-page' must be changed of course.

Quick test shows me it works.

Caveats:
- you might want to prevent normal editors to be able to edit those pages
- the content type that the webserver sends could be 'text/html' which actually is not right. You should test this on multiple browsers. Or maybe there is a way to change that behaviour via some php/UDT in the template.

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 10:10 am
by applejack
You don't have to use a Mac there are tons of Windows alternatives. Their are many advantages to using a dedicated editor and I don't mean Notepad.

In your case then use CGB's.

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 10:10 am
by Rolf
In that case you could use http://dev.cmsmadesimple.org/projects/cacheremotefile to create an external file...

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 10:43 am
by requish
Pretty cool solution. Thanks for that!

BUT >:D If I make page for client, he will see in page structure menu list these scripts. So if he enter there and change some things, page will break down... I'm right?

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 10:46 am
by Rolf
requish wrote:Pretty cool solution. Thanks for that!

BUT >:D If I make page for client, he will see in page structure menu list these scripts. So if he enter there and change some things, page will break down... I'm right?
Yes...
I have these pages under a dummy page, so they are not direct visible...

Re: [?]Module allows to add JS scripts similar cms_styleshee

Posted: Sat May 18, 2013 11:24 am
by requish
So OK, concept its OK :) and now how to hide this for clients and other users. I tried to do this using some module (news) to make the same thing. Unfortunately dont work (weird url at no prettyurl website is directing to nowhere).