定制 yoanmalie/kirbytextwrap 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yoanmalie/kirbytextwrap

Composer 安装命令:

composer require yoanmalie/kirbytextwrap

包简介

Kirby plugin to get rid of the kirbytext() <p> enclosing tag, or replace them and add HTML attributes. It Keep the kirbytag working.

README 文档

README

GitHub release License Kirby Version_2 Kirby Version_3

Kirby Plugin to remove or replace the <p> </p> enclosing tag and set HTML attributes. This will keep your kirbytag working.
Support both Kirby 2 and Kirby 3 version!

banner

How it works?

In your template, $page->title()->kirbytextWrap() will give you the same as kirbytext() without the <p> enclosing tag. This work also with the short ktw() alias.

Do much more

$page->title()->kirbytextWrap('h1') Will replace the <p> enclosing tag by <h1>.
$page->title()->kirbytextWrap('h1', ['class' => 'title']) Will replace the <p> enclosing tag by <h1> and add a class attribute with its value.

Put as many attributes as you want, you better create a variable for your array of attributes.

<?php
$attr = [
    'class' => 'dallas',
    'id' => 'larry',
    'aria-hidden' => 'true',
    'data-animation' => true,
];

echo $page->title()->kirbytextWrap('p', $attr);

Yeah cool but how to install?

You can install the kirbytextWrap plugin manually, with CLI, through Git submodule or with Composer.

  • Manually:
    Just download your desired version through the releases page, unzip and place the given folder into the site/plugin directory and rename it to kirbytextWrap.

  • Kirby CLI:

    kirby plugin:install yoanmalie/kirbytextwrap

    ⚠️ This will just work for Kirby 2 has CLI was removed on Kirby 3.

  • Git submodule:

    git submodule add https://github.com/yoanmalie/kirbytextwrap site/plugins/kirbytextWrap
    git submodule update --init --recursive
  • Composer:

    composer require yoanmalie/kirbytextwrap

Contributing

If you see a typo, or found a bug, please let me know! Share also your ideas through the issues tab.
Thanks for your help.

Clone this repo and run npm install.

git clone git@github.com:yoanmalie/kirbytextWrap.git
npm install

On each commit, Prettier will be run.

Credits

🤚 High five to @judbd who give me this plugin idea.
🎩 Hat tip to Jannik with his kirbytextRaw plugin who helped me when started to develop this plugin!

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固