Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tags to posts with many-to-many relation #44

Closed
bocharsky-bw opened this issue Apr 20, 2015 · 17 comments
Closed

Add tags to posts with many-to-many relation #44

bocharsky-bw opened this issue Apr 20, 2015 · 17 comments

Comments

@bocharsky-bw
Copy link
Contributor

Hi there!
What about to add Tag entity relates many-to-many with Post?
I think it will be very useful for beginners.
I vote 馃憤 for it. What do you think?

@King2500
Copy link

馃憤

1 similar comment
@jellyfyi
Copy link

馃憤

@javiereguiluz
Copy link
Member

I also think it's a good idea to add this many-to-many relation example. @bocharsky-bw thanks for proposing it!

@JulienItard
Copy link
Contributor

Or maybe many-to-many Categories instead? And, with it we could show render(controller()) in view to render categories list on sidebar with a posts count ?

@bocharsky-bw
Copy link
Contributor Author

@JulienItard Commonly, the categories more global than tags and better to relate Category to Post with one-to-many relation, I think.
What about render(controller()), it could be used for tags too, for example, to render tags list (or tags cloud) in sidebar with a posts count.

@b-durand
Copy link
Contributor

So category or tags?

@JulienItard
Copy link
Contributor

馃憤 tags

@voronkovich
Copy link
Contributor

Tags, because it will be able to add simple example how to use data transformers (Form).

@cyphos1973
Copy link

Yes for tags with entity relates many-to-many
plse
thanks

@andesk
Copy link
Contributor

andesk commented Jul 30, 2015

For tags, probably a lot of code could be reused from http://symfony.com/doc/current/cookbook/form/form_collections.html ? ;)

@ccab
Copy link
Contributor

ccab commented Aug 13, 2015

It could be interesting to show a nice js experience to the tags with the select2 library

@bocharsky-bw
Copy link
Contributor Author

I'm more inclined to the harvesthq/chosen library for this feature.

@xabbuh
Copy link
Member

xabbuh commented Sep 9, 2015

Apparently nobody opened a pull request yet.

@Rasanga
Copy link
Contributor

Rasanga commented Sep 10, 2015

I am going to create a PR for this

@yceruto yceruto mentioned this issue Jan 26, 2017
8 tasks
javiereguiluz added a commit that referenced this issue Feb 6, 2017
This PR was squashed before being merged into the master branch (closes #447).

Discussion
----------

Add tags to Post

This implements #44 and it's a complete variant of #192 (On hold since Ago 2016).

| Blog Post Index | Post Show |
| ---- | --- |
| ![tags-index](https://cloud.githubusercontent.com/assets/2028198/22331272/8f0522f8-e398-11e6-8efb-41b8ebb119f4.png)  |  ![tags-show](https://cloud.githubusercontent.com/assets/2028198/22331381/29aa391a-e399-11e6-9f5a-b09b25a86090.png) |

| Post New/Edit |
| --- |
| ![tagsinput](https://cloud.githubusercontent.com/assets/2028198/22348577/3263128e-e3da-11e6-8b62-25f9720f4275.png) |

Also this splits the only one fixture class into three classes (`UserFixtures`, `PostFixtures` and `TagFixtures`):
 - [x] To prevent mess and complexity.
 - [x] To avoid post title duplicated (slug issue).
 - [x] To fix example and explanation of: Sharing objects between fixtures (#192 (comment)).
 - [x] To add a new example about: Fixture ordering and `DependentFixtureInterface` (dependence between fixtures).

Add Translation:
 - [x] English
 - [x] Espa帽ol

Updated `blog.sqlite` and `blog_test.sqlite` DBs.

---

### Handling Tags (Bootstrap-tagsinput):

There is many options to do that:

 * Form collection to add new tags?
 * [`select2`](https://select2.github.io/examples.html) or [`chosen`](https://github.com/harvesthq/chosen) js plugins?
 * [Bootstrap tagsinput](http://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/) js plugin? <-- 馃憤
* [Tokenfield for Bootstrap](http://sliptree.github.io/bootstrap-tokenfield/) js plugin?

### TODO:
- [x] Create TagsInputType to handle the post tags collection (Added DataTransformer example)
- [x] Add typeaheadjs option to show tags hint.

Commits
-------

46a54dd Add tags to Post
@yceruto
Copy link
Member

yceruto commented Feb 7, 2017

Should be closed (#447)

@javiereguiluz
Copy link
Member

Closed as fixed 馃帀

@bogdaniel
Copy link

i used a data transformer with select2 and worked smoothly no problems :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.