Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
My first plugin: abu_catcloud
I started writing this plugin for my own use while migrating my site from Bludit to Textpattern.
It displays a weighted list of used article categories, and I think it might be useful for others too.
Offline
Re: My first plugin: abu_catcloud
Nice idea! Welcome to plugin authorship.
When you’re ready to update to the next version, you can save yourself some bytes and manual processing by using doWrap()
which takes the wraptag
, break
and class
attributes and applies them to the passed contained content/list. It also gives you access to wrapform
, breakform
, breakby
and host of other global attributes, plus the ufo/spaceship replacment <+>
.
There’s a companion doLabel()
for handling label/labeltag, although that function is a bit… pedantic, shall we say, so not everybody uses it.
I’d love our new UI Class library to be able to handle some of this stuff more intuitively over time, so we may farm more processing over, as we improve the library.
Thank you for sharing your plugin.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: My first plugin: abu_catcloud
Thanks for your welcome and your suggestions.
This brings me to a long-prepared question: Can I find some documentation for functions like extract()
, parse()
, getRows()
, and now doWrap()
? Or do I have to skim the core code for them?
Thanks
abu
Offline
Re: My first plugin: abu_catcloud
abu wrote #340923:
Can I find some documentation for functions like
extract()
,parse()
,getRows()
, and nowdoWrap()
? Or do I have to skim the core code for them?
Most of the internal functions are indeed documented in the core or on php.net (in the case of extract() for example), and you can look them up easily on GitHub by searching in the Textpattern repo and prefixing your search with function, e.g. function getRows and then click on the line number of the relevant search match (which brings you here for getRows()). The phpdoc block is mostly directly above the function showing usage and parameters, and clicking on a function in the code will usually show you where it is used in the right-hand panel (sometimes you need to “show more” to see its use in other files). If you go up a level in the right-hand pane (weirdly labelled “All symbols” in English), you’ll also see an overview of all parallel functions in that file in case you’re not sure whether you’ve got the right function.
TXP Builders – finely-crafted code, design and txp
Offline
Pages: 1