Is it possible to replace the standard tag field on BlogEntry with the auto-complete TagField?
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
bump.
This has to be a common requirement. Are there any resources on this?
Will
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
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.
@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