Allow styling entries by category in User CSS (#8397)

* Allow styling entries by category in User CSS

Since we have `data-feed`, it is useful to have `data-category` too.

Example of usage to hide titles in all entries that belong to a specific category ID:
```css
[data-category="6"] {
	.title { display: none !important }
	.summary {
		position: relative;
		bottom: 2rem;
	}
}
```

* Add `data-link` to entries in `reader.phtml`
This commit is contained in:
Inverle
2026-01-04 12:03:59 +01:00
committed by GitHub
parent ed632bb5c4
commit 4739bcc62e
2 changed files with 3 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ $today = @strtotime('today');
?><?= $useKeepUnreadImportant && ($this->feed->priority() >= FreshRSS_Feed::PRIORITY_IMPORTANT) ? ' keep_unread ' : ''
?>" id="flux_<?= $this->entry->id()
?>" data-entry="<?= $this->entry->id()
?>" data-category="<?= $this->feed->categoryId()
?>" data-feed="<?= $this->feed->id()
?>" data-priority="<?= $this->feed->priority()
?>" data-link="<?= $this->entry->link()

View File

@@ -37,8 +37,10 @@ $useKeepUnreadImportant = !FreshRSS_Context::isImportant() && !FreshRSS_Context:
?><?= $useKeepUnreadImportant && ($this->feed->priority() >= FreshRSS_Feed::PRIORITY_IMPORTANT) ? ' keep_unread ' : ''
?>" id="flux_<?= $this->entry->id()
?>" data-entry="<?= $this->entry->id()
?>" data-category="<?= $this->feed->categoryId()
?>" data-feed="<?= $this->feed->id()
?>" data-priority="<?= $this->feed->priority()
?>" data-link="<?= $this->entry->link()
?>"><?php $this->renderHelper('index/article'); ?>
</div><?php
endforeach;