If you also have the problem that the view link in the article write tab does not work for fixed articles because it points to the individual article instead to the section, then this plugin could be for you.
Download
This is a Textpattern CMS plugin.
It »fixes« the »view« link in the article write tab for fixed (sticky) articles if they are used as section article.
Usage
Install and activate the plugin.
Changelog
Version 0.1.0 – 2024-10-31
trenc am 31. Oktober 2024
|
I’ve written a simple url cache for Textpattern CMS. I use it for caching API content or shared static HTML from one source. It’s relativly straightforward.
You can grab it from GitHub. The compiled plugin version is located under the /dist folder.
yab_api_cache
Simple url cache.
Caches the outout of an url (simple GET APIs, URIs, websites etc.).
It can also be used to cache dynamic pages of the own website. Especially the ones with a lot of huge dynamic lists (but you can also use etc_cache parts of the site).
Version: 0.1.2
Table of contents
- Plugin requirements
- Configuration
- Tags
- Examples
- Changelog
- License
- Author contact
Plugin requirements
Configuration
Open the plugin code. The yab_api_cache function contains the configuration values. Can also be configured by tag attributes. See tag attribute for info.
yab_api_cache
This tag will output the content of a given url live or cached.
id: any valid string or empty
Default: not set
A valid string to identify the content, If not provided ist will be generated by md5 the utl attrbiute.
url: a valid string (URI)
Default: null
The URI which to be requested and shown
cached: integer|bool (1|0)
Default: true
If set to 0 (false) the requested content is live instead of the cached one.
cache_time: integer (seconds)
Default: 3600
Cache time in seconds
clear_cache: integer|bool (1|0)
Default: false
If set to 1 (truly) it will clear the entire cache.
Examples
Example: simplest
<txp:yab_api_cache url="https://exmaple.com/api/show/users" />
Shows the cached output of the given url. Renews the chache after 1 hour (3600 seconds). The md5 hash of the url is used as id.
Example: advanced
<txp:yab_api_cache id="my-api-call" url="https://exmaple.com/api/show/users" cache_time="86400" />
Shows the cached output of the given url. Renews the chache after 1 day (86400 seconds). An own id is privided
Example: no-cache
<txp:yab_api_cache id="my-api-call" url="https://exmaple.com/api/show/users" cached="0" />
Shows the live output of the given url. An own id is privided.
Example: reset
<txp:yab_api_cache clear_cache="1" />
Clears the entire cache (Empties the table).
Changelog
- v0.1.2 – 2020-03-21
- modified: add plugin help, public release
- v0.1.1 – 2018-02-14
- bugfix: id and url will be parsed
- modifed: id not mandatory, will be created by url
- v0.1.0 – 2017-10-29
Licence
This plugin is released under the GNU General Public License Version 2 and above