plenta/contao-news-like-bundle

将您的点赞按钮集成到 contao 新闻中。

安装: 38

依赖: 0

建议: 0

安全: 0

星标: 3

关注者: 2

分支: 0

开放问题: 0

类型:contao-bundle

1.1.0 2023-11-30 12:49 UTC

This package is auto-updated.

Last update: 2024-08-30 01:39:46 UTC


README

将您的点赞按钮集成到 contao 新闻中。

安装

使用 Contao Manager 安装

搜索 news like 并找到此扩展。

使用 Composer 安装

composer require plenta/contao-news-like-bundle

系统要求

  • PHP: ^8.1
  • Contao: ^4.13 || ^5.1
  • Contao News Bundle: ^4.13 || ^5.1

使用方法

您可以使用我们的新闻模板或将点赞按钮集成到您自己的模板中。

使用我们的新闻模板

在新闻列表和/或新闻阅读器模块中,您可以选择我们的模板 news_latest_with_likesnews_full_with_likes 作为新闻模板。

将点赞按钮集成到您的模板中

要将点赞按钮集成到您的模板中,只需在您想要显示按钮的地方包含我们的 _plenta_likes.html.twig Twig 模板。

在 PHP 模板中

<?php $this->insert('_plenta_likes', ['news' => $this->arrData]) ?>

在 Twig 模板中

{% include('@Contao/_plenta_likes.html.twig' with {news: _context}) %}

news 变量期望新闻项为数组。