Forums / Developer / OE 4.1.1 and Custom tags

OE 4.1.1 and Custom tags

Author Message

Patrice DUCLAUD

Thursday 06 July 2006 2:31:12 am

Hi,

[eZpublish 3.6.2 and OE 4.1.1],
I've created a custom tag called "MyCust", by example :

<div class="MyClass">
<img src="My_Image" border="0" />
<p>{$content}</p>
</div>

Without Online Editor i use this custom tag in an xml block like this :

<custom name="MyCust">...Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla ... </custom>

when my article is published, i can see
My_image
and
...Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla Bla bla bla ...
using {$content}

Now

I would like to use Online Editor to create a new article using my custom tag "MyCust".
I can select MyCust using the custom tags selection list in OE, but I can't make {$content} appears in my new article .

any idea ?
Thanks in advance.

Patrice

Nathan Kelly

Thursday 06 July 2006 3:10:24 am

Check your debug output, you may find a warning that the custom tag template can't be found.

If thats the case you need to make sure the custom tag template is in the right location. This should be <siteaccess>/templates/content/datatype/view/ezxmltags/<yourtemplate> or the same folder in the <standard> design folder.

Also in the settings folder under your <siteaccess> you need to put a content.ini.append.php (if you don't have one) and under CustomTagSettings:

[CustomTagSettings]
AvailableCustomTags[]=MyCust

Hope this helps, if not let me know.

Cheers!

Pardon me while I burst into flames...

Nathan Kelly

Thursday 06 July 2006 3:20:28 am

Another note:

Make sure your template name is identical to the custom tag you specified in the content ini.

if your template is named - mycust.tpl make sure you specify AvailableCustomTags[]=mycust

eg. MyCust.tpl would need AvailableCustomTags[]=MyCust

On that note I'd avoid CammelCase and use lowercase only with my_cust format.

Cheers!

Pardon me while I burst into flames...

Patrice DUCLAUD

Thursday 06 July 2006 4:59:24 am

Thanks Nathan,

Every things seems to be good according to my custom tag, no warning, no error in the debug output, the name of the .tpl is similar to the name of the custom tag and the custom tag is in <siteaccess>/templates/content/datatype/view/ezxmltags/<yourtemplate>... (and without OE, the use of custom tags is good).

. I write some texte in the text area of the custom tag properties but I don't know how to use this text in my template.

. If I create an attribute in OE (custom tag properties), named "content" and if I write some text in Value Area, no content value is displayed when i use {$content} in my template to show the content of the custom tag.

The custom tag is inline and not a block, is there a problem, and what must I do to have à block in the cuxtom tag properties (admin interface, i edit the custom tag in the xml block of my article, right clic and properties) ?

Is there a documentation according to the use of custom tags with OE ?

Patrice

Kirill Subbotin

Thursday 06 July 2006 3:05:11 pm

First there is a doc:

http://ez.no/doc/extensions/online_editor/4_x/usage/the_toolbar/the_custom_tag_button

Your custom tag should be block (it is block by default if not mentioned in "IsInline" array of the content.ini ). XML created with OE is not different from XML created when OE is disabled. Block tag is displayed as a one-cell table in OE and the content of this cell is the content of the custom tag and is passed in {$content} variable as usually. You can switch OE on and off after inserting custom tag to make sure it generates correct XML.

Patrice DUCLAUD

Friday 07 July 2006 12:23:27 am

Thanks Kirill,

Sometimes, you look for something, you are not far from what you want but you don't find it, even if you have the answer in front-of you ... some days are bad days, yesterday it was a bad day for me ... The IsInline[MyCust] attribute was not good.
and this morning ...
it seems to me it's a good day, according to your very good answer, the link to the doc ..., now my custom tag are Ok ;-)))

Thanks

Patrice