Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Расширения / Навигация и структура / 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?

Всего: 4, на странице: 4

Для этого элемента нельзя добавлять комментарии