Forums / Setup & design / Custom "Raw" tag

Custom "Raw" tag

Author Message

Marvin Gardens

Monday 04 May 2009 6:46:03 am

I'm trying to make a tag that just spits out the content of the tag untouched. Similar to <literal> but without the <pre> tags wrapping it.

Here is what I have so far:

First content.ini appends in both my custom siteaccess as well as the admin site access:

<b>settings/siteaccess/custom_site/content.ini.append.php</b>
[CustomTagSettings]
AvailableCustomTags[]
AvailableCustomTags[]=raw
IsInline[raw]=true

<b>settings/siteaccess/admin/content.ini.append.php</b>
[CustomTagSettings]
AvailableCustomTags[]
AvailableCustomTags[]=raw
IsInline[raw]=true

Next the design, which is simply content spit out:

<b>design/custom_site/templates/content/datatype/view/ezxmltags/raw.tpl</b>
{$content}

And finally trying to use it in ezpublish:
<custom name='raw'>
<form> <more straight html tags and text> </form>
</custom>

I've cleared cache and try to save the above article and get:
<b>
The draft could not be stored.
Required data is either missing or is invalid:
* Body: Unknown tag: <form>.
</b>

Marvin Gardens

Monday 04 May 2009 6:47:14 am

Sorry, hit submit too soon. Can anyone see anything wrong with what I've done, or have a suggestion or pointer as to how I can do this?

Thanks in advance
Marvin

André R.

Monday 04 May 2009 7:47:38 am

Use literal, its the only tag that supports this.
Then use a specific class to ouput the html directly, the html class disabled by default does this. It's disabled since it is a security issue to let everyone input raw html (hint: javascript).

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

Marvin Gardens

Monday 04 May 2009 10:00:48 am

So now I have

[literal]
AvailableClasses[]=html

in my content.ini.append.php in both my custom siteaccess and admin. Looking at the literal.tpl, that should just spit out the straight html, but I can't save the draft with:

<literal class='html'>
blah blah blah
</literal>

I get the error:
<b>Body: Class 'html' is not allowed for element <literal> (check content.ini).</b>

I clear the cache after each ini edit (well after every edit until I can figure this out).

Am I missing a step to enable the html.

m.

P.S. we have one dependable editor so we are good turning on html.
P.P.S too bad custom won't accept tags... that would be a nice feature.

André R.

Monday 04 May 2009 11:18:17 am

Take a look at this setting in setup -> ini -> content.ini + your admin siteaccess to see if it is overwritten somewhere.

> P.S.

Ok, should be safe then.

> P.P.S.

custom tags and literal tags are for different purposes, custom tags can be nested and contain other tags so child tags are ezxml, and not threated like raw text.

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

eZ debug

Timing: Jan 31 2025 06:16:04
Script start
Timing: Jan 31 2025 06:16:04
Module start 'content'
Timing: Jan 31 2025 06:16:04
Module end 'content'
Timing: Jan 31 2025 06:16:04
Script end

Main resources:

Total runtime0.2316 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.8203180.8516
Module start 'content' 0.00540.0053 768.671997.8359
Module end 'content' 0.01070.2208 866.5078529.2500
Script end 0.2315  1,395.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00321.4023200.0002
Check MTime0.00130.5531200.0001
Mysql Total
Database connection0.00080.340310.0008
Mysqli_queries0.179677.54301410.0013
Looping result0.00140.60211390.0000
Template Total0.220595.210.2205
Template load0.00090.368710.0009
Template processing0.219694.810410.2196
Override
Cache load0.00060.269410.0006
Sytem overhead
Fetch class attribute can translate value0.00070.298410.0007
XML
Image XML parsing0.00030.132610.0003
General
dbfile0.01285.5474200.0006
String conversion0.00000.002130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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