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

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