Forums / Setup & design / Custom tags not working

Custom tags not working

Author Message

Martin Crockett

Wednesday 23 February 2005 4:02:43 am

Hi,

I have followed all the example instructions in http://www.ez.no/ez_publish/docum...ents/datatypes/ezxmltext/custom_tags
but my site still fails to find this custom tag.

Can anyone think why? This is what I did:

1. Added my file (mynewline.tpl) to design/<my site name>/templates/content/datatype/view/ezxmltags

2. Created the mynewline.tpl with my HTML

3. Added my custom tag to content.ini.php file (under settings/siteaccess/<my site name>/ and (under settings/siteaccess/<my site name>_admin/

4. Cleared the cache.

Still, it refuses to display when manually called and the Online Editor refuses to recognise it. Mystery?

Any help gladly appreciated.

M

Mads Ovesen

Thursday 24 February 2005 5:13:38 am

Try to add the custom tag to content.ini.php (under settings/override/)

- Mads

/m

Martin Crockett

Thursday 24 February 2005 6:31:50 am

Yes, thank you! It works!

I had to create a 'content.ini.php' file from scratch and simply add the reference to the mynewline.tpl - hey, presto!

If only the documentation could have said this - would have prevented 2 days of mine being wasted! ;-)

Balazs Halasy

Thursday 24 February 2005 7:31:18 am

Hi,

The new documentation (which we're currently working on) already covers this part.. let me copy & paste the info that you were looking for:

-----------8<--------------8<--------------------
Custom tags

In addition to the default tags described above, the "XML field" datatype makes it possible to use custom tags. A custom tag can be used both as a block or an inline element. Custom tags must be specified using the "AvailableCustomTags[]" array in the [CustomTagSettings] block within an override for the "content.ini" configuration file. When the XML is rendered, the contents of a custom tag is replaced by a template. The name of the template must be specified using the "name" parameter. Usage:

<custom name="template_name" [custom_parameter='value' ...] >
The quick brown fox jumps over the lazy dog.
</custom>

The tag in the example above will be replaced by a template called "template_name.tpl". The template must be located inside the following directory within a design: "/templates/content/datatype/view/ezxmltags/". If not, an override template should be created. The contents of the tag will be available in the "$content" variable within the inserted template. The custom parameters are optional. When used, a custom parameter will be available as a template variable with the same name as it was specified in the tag itself.

-----------8<--------------8<--------------------

Allman

eZ debug

Timing: Jan 18 2025 11:22:37
Script start
Timing: Jan 18 2025 11:22:37
Module start 'content'
Timing: Jan 18 2025 11:22:38
Module end 'content'
Timing: Jan 18 2025 11:22:38
Script end

Main resources:

Total runtime1.4232 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 587.7031180.8438
Module start 'content' 0.00841.2480 768.5469596.0938
Module end 'content' 1.25640.1667 1,364.6406337.3828
Script end 1.4231  1,702.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00470.3276210.0002
Check MTime0.00160.1140210.0001
Mysql Total
Database connection0.00070.048610.0007
Mysqli_queries1.336493.90571990.0067
Looping result0.00240.17001970.0000
Template Total1.375096.620.6875
Template load0.00230.158820.0011
Template processing1.372896.459220.6864
Template load and register function0.00020.015010.0002
states
state_id_array0.00400.281810.0040
state_identifier_array0.00120.087720.0006
Override
Cache load0.00190.1369340.0001
Sytem overhead
Fetch class attribute can translate value0.00140.095840.0003
Fetch class attribute name0.00150.103760.0002
XML
Image XML parsing0.00330.232140.0008
class_abstraction
Instantiating content class attribute0.00000.001170.0000
General
dbfile0.00640.4470330.0002
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs