Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Use TagField with BlogEntry?


Reply


5 Posts   909 Views

Avatar
bmc38119

Community Member, 45 Posts

4 January 2011 at 10:43am

Is it possible to replace the standard tag field on BlogEntry with the auto-complete TagField?

Avatar
kindlemanwill

Community Member, 68 Posts

14 October 2011 at 7:06pm

bump.

This has to be a common requirement. Are there any resources on this?

Will

Avatar
Juanitou

Community Member, 323 Posts

14 October 2011 at 10:28pm

Hi Will,

This is not recommended, but you can replace in BlogEntry the line 81 with:

if(class_exists('TagField')) {
   $tagfield = new TagField("Tags", _t("BlogEntry.TS", "Tags (comma sep.)"), null, "BlogEntry");
   $tagfield->setSeparator(', ');
   $fields->addFieldToTab("Root.Content.Main", $tagfield, "Content");
} else {
   $fields->addFieldToTab("Root.Content.Main", new TextField("Tags", _t("BlogEntry.TS", "Tags (comma sep.)")),"Content");
}

Hope it helps,
Juan

Avatar
BuddhaSource

Community Member, 57 Posts

17 October 2011 at 4:05pm

So this works ?

Can I put this code in mysite ? I don't want to edit the blog code, its a problem when you upgrade.

Avatar
kindlemanwill

Community Member, 68 Posts

3 November 2011 at 6:21pm

@buddhaSource - no not in mysite - in the BlogEntry class instead of the regular field.

I'm not getting good results with it though. seems pretty buggy

w