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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom tags to articles, and show custom tags as virtual categories #928

Closed
Alkarex opened this issue Jul 28, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@Alkarex
Copy link
Member

commented Jul 28, 2015

See #922 (comment)

@Alkarex Alkarex added this to the 2.0.0 milestone Jul 28, 2015

@Alkarex

This comment has been minimized.

Copy link
Member Author

commented Aug 4, 2015

I believe the main needs will be:

  1. add new tag to existing article (entry);
  2. retrieve the list of articles matching a tag (virtual category);
    • Requires an index on the tag
  3. show all tags for an article;
    • Requires an index on the article or article reference

There are several approaches for the SQL model, with different advantages/drawbacks.

Here is the variant 1, in which tags are referenced by an integer. It offers the easy possibility of changing the name of the tag, and using a long tag name should not affect performances. Articles (entries) can have several tags.

CREATE TABLE IF NOT EXISTS `tag` (
    `id` SMALLINT NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY (`name`)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
ENGINE = INNODB;

CREATE TABLE IF NOT EXISTS `tags` (
    `id_tag` SMALLINT NOT NULL,
    `id_entry` BIGINT NOT NULL,
    FOREIGN KEY (`id_tag`) REFERENCES `tag`(`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    FOREIGN KEY (`id_entry`) REFERENCES `entry`(`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    INDEX (`id_entry`),
    UNIQUE KEY (`id_tag`,`id_entry`)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
ENGINE = INNODB;
@Alkarex

This comment has been minimized.

Copy link
Member Author

commented Aug 4, 2015

We also need to decide what to do with the tags provided by the RSS feed:

  1. Keep them in the entry table as they are now;
  2. Merge them with the new tagging system, with a flag to distinguish custom tags;
@rolero

This comment has been minimized.

Copy link

commented Aug 4, 2015

I would keep the existing tags and add a flag for custom tags. The tags provided by the RSS feed item tells something about the content of the feed item while the "custom" tag set by the user, can also be used to initiate workflows. For example. RSS item is received with tag "x", User reads the articles and makes the conclusion it should be used on the website. Therefor the user adds the tag "candidate for website". After one week the user selects all the articles with the tag "candidate for website and re-publish them. In the future and extension could be added to select RSS items by tag and push them into an automated workflow. You could integrate FreshRSS for example with ifttt.com or Mailchimp to generate newsletters.

@rolero

This comment has been minimized.

Copy link

commented Aug 4, 2015

Another solution would not to use the tag system but the existing sharing solution for it. Maybe a general approach where you can add new share options as an extension. Instead of sharing to Facebook or Twitter you share to an extension. The extension takes care of everything while FreshRSS just provides an general way of pushing the data forward.

@Alkarex Alkarex modified the milestones: Backlog, 1.12.0 Sep 15, 2018

@Alkarex Alkarex self-assigned this Sep 15, 2018

Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Sep 16, 2018

@Alkarex Alkarex referenced this issue Sep 16, 2018

Merged

Custom labels #2027

@Alkarex

This comment has been minimized.

Copy link
Member Author

commented Sep 23, 2018

Implemented in #2027
Tests welcome

Alkarex added a commit that referenced this issue Sep 29, 2018

Custom labels (#2027)
* First draft of custom tags

#928
#1367

* SMALLINT to BIGINT for id_entry

And uppercase SQL types

* Fix layout for unreads

* Start UI menu

* Change menu order

* Clean database helpers

#2027 (comment)

* Travis rules do not understand PostgreSQL constants

Grrr

* Tag controller + UI

* Add column attributes to tags

* Use only favicon for now, for label

* Fix styling for different themes

* Constant for maximum InnoDB index length in Unicode

#2027 (comment)
(I would have personnally prefered keeping the readability of a real
value instead of a constant, in this case of many SQL fields)

* Use FreshRSS_Factory::createCategoryDao

* Add view of all articles containing any tag

* Fix search in tags

* Mark as read tags

* Partial auto-update unread tags

* More auto update tag unreads

* Add tag deletion

* Do not purge tagged articles

* Minor comment

* Fix SQLite and UI bug

* Google Reader API support for user tags

Add SQL check that tag names must be distinct from category names

* whitespace

* Add missing API for EasyRSS

* Compatibility SQLite

Problematic parentheses

* Add SQL DISTINCT for cases with multiple tags

* Fix for PostgreSQL

PostgreSQL needs some additional type hint to avoid "could not determine
data type of parameter $1"

http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html

@Alkarex Alkarex closed this Sep 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.