Store external text-based files as TxP articles
HowTo: Store external text-based files inside Textpattern as articles.
Benefits:
- Store all files in one place – MySQL database.
- Gzip compress for output. It’s actual for large javascript library such as jquery.
- Allow edit text files from Textpattern interface.
- Allows you to group and manage files as ordinary articles.
Other:
- If your need, make own RSS feed for your files.
- If your need, open comments for your files.
HowTo make it:
1. Install plugin aks_header
Get and install plugin aks_header
2. Create new page template “textfile”
<txp:aks_header file="1" strip="0" gzip="1" /><txp:article><txp:body /></txp:article>
3. Create new Section “file”
4. Exclude section “file” from your sitemap (optional)
5. Create new article (e.g. text-based file text/css/js/xml)
- Article Markup – MUST be Leave text untouched
- URL-only title – set correct extension for file
- Section – MUST be file
Optional:
- Fill Keywords (used tru_tags, etc)
- Set Category1, Category2
- Set categories rss_unlimited_categories
- Excerpt – some description, etc…
6. It’s ALL.
See result: aks_header.txt
Textpattern Tips and Tricks: |