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   879 Views

Avatar
bmc38119

4 January 2011 at 10:43am Community Member, 45 Posts

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

Avatar
kindlemanwill

14 October 2011 at 7:06pm Community Member, 68 Posts

bump.

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

Will

Avatar
Juanitou

14 October 2011 at 10:28pm Community Member, 323 Posts

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

17 October 2011 at 4:05pm Community Member, 57 Posts

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

3 November 2011 at 6:21pm Community Member, 68 Posts

@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