Beginning, A Textpattern Plugin
||The Textpattern Community
Update: Running Textpattern 4.0.4? Try Beginning 0.7
Note: For those familiar with using previous versions of the plugin (pfa_beginning or ede_beginning) this is simply an update of those plugins with a new name, so it remains backward-compatible with sites developed around recent versions of those plugins. This new version is meant to replace those older versions, so do not have both old and new versions enabled on your site at the same time.
Summary: This plugin automatically generates excerpts from the body of each article based on attributes you provide. Attributes include, length of excerpt, text of a “read more” link, the css class applied to a span that wraps around this link, the format of the link (inside or outside the paragraph), and the name of a custom field to use to specify the “read more” link.
From the Plugin Help:
- length=”xxx” – The number of characters before the plugin generates the excerpt at the end of the current paragraph. Default is 350.
- linktext=”Read More” – The text to be displayed as the permalink to the rest of the article
- styleclass=”morelink” – The css class applied to the link. Default is ‘read-more’. A value of “0” will prevent a class attribute from even being generated in the html.
- format=”inside” – This sets whether the ‘read more’ link is placed inside the excerpts paragraph or not. If the value is not set or not ‘inside’ then the plugin will revert to the default (original) format of placing the link after the excerpts closing paragraph tag.
- cfield=”continue” – This sets the name of the custom field to check for an alternative link text. The default custom field name is continue and the if the custom field is empty the plugin will use the value set by the linktext attribute.
<txp:beginning length="250" format="inside" linktext="Read More" styleclass="morelink" cfield="continue" />
What about pfa_beginning and ede_beginning?
This is the outgrowth of these plugins, just without authors’ initials preceding the name of the plugin. The Beginning plugin is backward compatible with pfa_beginning and ede_beginning. This plugin replaces those earlier versions, so do not have multiple versions (pfa_beginning, ede_beginning, Beginning) enabled at the same time. The only change from earlier versions is the name of the plugin, a bug fix, and the default value for the styleclass attribute, which is now “read-more”.
This plugin was initially developed and maintained by Philip Ashlock, but has been maintained with the code and collaboration of several additional people including: Ed Everett, schmoboy, Kurt Raschke, Julian Stahnke, alexbrie, and who’s next?
Since the plugin is the result of several people’s work, it will no longer be referred to as either pfa_beginning or ede_beginning, but instead simply Beginning. The convention of using the author’s initials before the name of the plugin is not compatible with collaborative authorship, so in this case it will be dropped. As the initial developer, and noting the fact that textpattern is released under the GPL, I ask that this plugin be kept open-source and that all contributors be credited. This plugin is released under the GPL license.