FPNTagBundle icon indicating copy to clipboard operation
FPNTagBundle copied to clipboard

Get Tags related to an Article Id

Open melkir opened this issue 11 years ago • 2 comments

Hi, How can I get the tag list related to an article id ?

I've try to use in my indexAction controller $listPost = $tagManager->loadTagging($post); and render to my view the listPost but the listPost is null :(

Same for $listPost = $post->getTags();

Finally i need an getResourceTagsForId methods like getResourceIdsForTag provided in the manual instruction (the reverse order).

melkir avatar Jun 03 '13 15:06 melkir

Ok problem solved; i have add to my controller $tagManager = $this->get('fpn_tag.tag_manager'); $tags = $tagManager->loadTagging($article); And I my view {% for tag in article.tags %} {{ tag }} {% endfor %}

Now I need a form with a field for tags ! but when i submit the form I have setTags() Maybe you should create the method "setTags()"?

I know how to add value with the tag manager but not with set method :( !

melkir avatar Jun 04 '13 14:06 melkir

To handle forms you need a DataTransformer and a widget. More info at https://github.com/FabienPennequin/FPNTagBundle/issues/7

tfernandez avatar Nov 04 '13 08:11 tfernandez