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 :-)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:10:18
Script start
Timing: Jan 18 2025 16:10:18
Module start 'layout'
Timing: Jan 18 2025 16:10:18
Module start 'content'
Timing: Jan 18 2025 16:10:18
Module end 'content'
Timing: Jan 18 2025 16:10:18
Script end

Main resources:

Total runtime0.0133 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 587.9063152.6250
Module start 'layout' 0.00460.0022 740.531339.4453
Module start 'content' 0.00690.0048 779.976697.4297
Module end 'content' 0.01160.0016 877.406338.3047
Script end 0.0132  915.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002317.2176140.0002
Check MTime0.00107.2320140.0001
Mysql Total
Database connection0.00064.805810.0006
Mysqli_queries0.001813.919130.0006
Looping result0.00000.066510.0000
Template Total0.00139.810.0013
Template load0.00075.453210.0007
Template processing0.00064.338110.0006
Override
Cache load0.00053.780610.0005
General
dbfile0.00118.296880.0001
String conversion0.00000.046840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs