承接 rah/zem_nth 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

rah/zem_nth

Composer 安装命令:

composer require rah/zem_nth

包简介

Step in a list plugin for Textpattern

关键字:

README 文档

README

Download | Packagist | Twitter | Donate

Step in a list. The zem_nth plugin adds a conditional tag to Textpattern CMS, which can be used to matches every nth item in a group of items based on the given step and group of. This tag works similarly to the :nth-child pseudo-selector found in CSS.

Installing

Using Composer:

$ composer require rah/zem_nth:*

Or download a plugin package.

Tag attributes

<txp:zem_nth step="1" of="3">
	...every third...
<txp:else />
	...first and second...
</txp:zem_nth>

The tag can also be used as a single, self-closing tag to return the current counter value:

<txp:zem_nth id="counter-identifier" />

Attributes are as follows:

step
The step to jump.
Example: step="2" Default: "2"

of
Step of how many.
Example: off="4" Default: undefined

id
The identifier assigned to the counter. By default counters are identified by their contents. If you need multiple counters for identical code blocks, you can use the id attribute to set your own identifier to prevent collisions. The id attribute can also be used to connect two counters with different contents that wouldn’t normally be connected.
Example: id="article_sidebar_stripes" Default: undefined

start
The value the counter starts from. This allows resuming a previous counter, or just to add padding.
Example: start="25" Default: "0"

reset
If set to 1, resets the current counter back to the starting value set with start.
Example: reset="1" Default: "0"

Toolshed notice

This is a toolshed project. Experimental and not part of the main supported product line of Rah. Not yet at least. Please use at your own risk.

Examples

Striped article list

Adds even and odd classes to posts.

<txp:article_custom>
    <div class="<txp:zem_nth step="1" of="2">odd<txp:else />even</txp:zem_nth>">
        <h2><txp:title /></h2>
        <txp:body />
    </div>
</txp:article_custom>

Return current counter value

Display article number.

<txp:article_custom>
    <h2>#<txp:zem_nth id="article-number" />: <txp:title /></h2>
</txp:article_custom>

Changelog

Version 0.3.0 – 2014/03/18

  • Fixed: Prevent possible collisions within the step, contained statement and of when calculating identifier.
  • Added: If used as a self-closing tag, returns the current counter value.
  • Now requires PHP 5.2.0 or newer.

Version 0.2.2 – 2013/05/05

  • Fixed: Reported version number.

Version 0.2.1 – 2013/05/05

  • Fixed: Composer package requirements.

Version 0.2.0 – 2013/05/05

  • Added: <txp:else /> support.
  • Added: id attribute. Allows avoiding collisions and starting new counters, where the contents and the attributes are the identical, but the counter should restart from zero. Can also be used to connect counters that wouldn’t normally match.
  • Added: start attribute. Allows changing the counter’s starting value.
  • Added: reset attribute. Resets the counter back to zero.

Version 0.1.0 – 2004/08/26

  • Initial release.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2013-04-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固