manuxi/sulu-abbreviations-bundle

欢迎来到Sulu缩写插件!

安装: 49

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

1.5.7 2024-09-20 22:54 UTC

README

php workflow symfony workflow License: MIT GitHub license

我制作了这个插件,以便在我的项目中管理缩写。

此插件包含:

  • 缩写内容类型的多个过滤器
  • 链接提供者
  • 网站地图提供者
  • 垃圾项目处理器
  • 自动化处理器
  • 将联系人分配为作者的选项
  • 用于解析缩写/获取缩写列表的Twig扩展
  • 用于显示活动等的事件

缩写可翻译。

请随时提交功能请求。此插件仍在开发中。使用风险自担 🤞🏻

👩🏭 安装

使用以下命令安装包

composer require manuxi/sulu-abbreviations-bundle

如果您没有使用Symfony Flex,您还需要在config/bundles.php文件中添加该插件

return [
    //...
    Manuxi\SuluAbbreviationsBundle\SuluAbbreviationsBundle::class => ['all' => true],
];

请在您的routes_admin.yaml中添加以下内容

SuluAbbreviationsBundle:
    resource: '@SuluAbbreviationsBundle/Resources/config/routes_admin.yml'

最后但同样重要的是,需要更新数据库模式。

将创建一些表(以app_为前缀)
abbreviations, abbreviations_translation.

使用以下命令查看所需的查询

php bin/console doctrine:schema:update --dump-sql

通过执行以下命令更新模式

php bin/console doctrine:schema:update --force

请确保您只处理插件的方案更新!

🎣 使用

首先:授予缩写的权限。重新加载后,您应该在导航中看到缩写项。开始创建缩写。使用smart_content属性类型显示缩写列表,例如。

<property name="abbreviations" type="smart_content">
    <meta>
        <title lang="en">Abbreviations</title>
        <title lang="de">Abbreviations</title>
    </meta>
    <params>
        <param name="provider" value="abbreviations"/>
        <param name="max_per_page" value="5"/>
        <param name="page_parameter" value="page"/>
    </params>
</property>

缩写列表的对应twig模板示例

{% for abbreviation in abbreviations %}
    <div class="col">
        <h2>
            {{ abbreviation.name }}
        </h2>
        <p>
            {{ abbreviation.explanation|raw }}
        </p>
    </div>
{% endfor %}

🧶 配置

不存在配置。

👩‍🍳 贡献

为了简化,这个扩展保持较小。请随时提交问题或拉取请求。一如既往,我很高兴得到您的反馈以改进扩展 :)