Forums / Setup & design / Javascript in the admin

Javascript in the admin

Author Message

Andy Boston

Wednesday 15 August 2007 8:54:20 am

Can anyone tell me a simple solution as to how I can put javascript directly into the admin fields so it shows on the site???

Mark Marsiglio

Wednesday 15 August 2007 9:08:37 am

Use the custom tag "literal" and use the class "html". That should allow you to put some any content in that you want and it will be rendered as code.

You may need to enable it in the content.ini settings.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Andy Boston

Thursday 16 August 2007 5:23:16 am

Thanks Mark...

I don't suppose you could tell me a bit more in depth on how to do that?

I'm just a designer that normally makes things look pretty so I'd appreciate an example.

Andy Boston

Thursday 18 October 2007 2:10:41 am

Is there some documentation on how to do this for non coders???

André R.

Thursday 18 October 2007 4:24:43 am

Well, you don't have to be a developer, but knowledge about eZ Publish helps a lot..

Documentation on <literal class="html">Anything goes here</literal> can be found in settings/content.ini (search for '[literal]'):

[literal]
AvailableClasses[]
# The class 'html' is disabled by default because it gives editors the
# possibility to insert html and javascript code in XML blocks.
# Don't enable the 'html' class unless you really trust all users who has
# privileges to edit objects containing XML blocks.
#AvailableClasses[]=html

For how to work with the configuration files, take a look here:
http://ez.no/doc/ez_publish/technical_manual/3_10/concepts_and_basics/configuration

Alternatively you can create your own custom XML tag (but you still need to get down and dirty with configuration files):
http://ez.no/doc/extensions/online_editor/4_x/usage/formatted_text/block_and_inline_elements#comment6815

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Andy Boston

Friday 19 October 2007 5:44:43 am

Thanks for the information Andre :-)