Page Text by ID

Fetches page text and puts it into a global tag

This plugin is a more modern and universal replacement for pagetextbyidn plugin. It provides a function that can be used as CoTemplate callback to fetch text for any page anywhere on site.

#1. Installation

  1. Download and unpack the plugin.
  2. Copy 'pagetextbyid' folder to your Cotonti plugins folder.
  3. Install it in Administration / Extensions.

#2. Usage

The most basic usage for this plugin is a TPL tag looking like this (the example below inserts parsed text for a page with ID = 123):

{PHP|pagetextbyid(123)}

For more advanced usage you can chain callbacks. The following example fetches text for page with ID = 456, strips all HTML tags from it and inserts at most 50 characters of it:

{PHP|pagetextbyid(456)|strip_tags|mb_substr($this, 0, 50)}

1. Kingsley  14.01.2012 18:20

Im sorry, but I do not fully comprehend it's usefullness. Can you provide me with an example? thx..

2. fade2k  14.01.2012 23:53

I think it could be useful for displaying specific text on differnet parts of the site, providing an easy alternative to having to upload template files if something is changed (can just edit a page instead). I'm sure there are other uses too... Just going off what came to mind first.

3. Trustmaster  15.01.2012 08:09

fade2k is right, it's mostly used for that

4. Kingsley  16.01.2012 01:37

kinda like the contact block in the Nemesis skin?

5. Eugene  09.08.2012 11:52

Guys, you may consider adding this plugin to main pack. It is not like it is VERY popular among developers. But my point here is more about new-comers to Cotonti. This is VERY easy-to-use plugin: easy to tune, easy to manipulate - consistant behavior through diff templates...

I guess, that also would help many people, who occasionally made their choice of CMS and need very cimple web-site with few pages ( which are not organized even in their minds ))))

6. Trustmaster  27.08.2012 19:28

The chances of putting this to our minimalized standard pack are very low. But there are chances more such widget-like plugins are released :)

Добавление комментариев доступно только зарегистрированным пользователям