Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Feedback: Textpattern CMS 4.8.7 released: bug fixes, tweaks, hurrah!
Thanks, that’s it …
$msg .= image( array("id"=>$item["image"], "loading"=>"lazy") );
to
$msg .= processTags('image', array("id"=>$item["image"], "loading"=>"lazy"));
Last edited by whocarez (2021-07-23 10:44:37)
Offline
Re: Feedback: Textpattern CMS 4.8.7 released: bug fixes, tweaks, hurrah!
Stupid question: do I have to include txplib_publish.php
to get rid of Fatal error: Uncaught Error: Call to undefined function processTags()
errors?
include_once $_SERVER["DOCUMENT_ROOT"]."/textpattern/lib/txplib_publish.php";
Or is there a more Textpattern way?
Offline
Re: Feedback: Textpattern CMS 4.8.7 released: bug fixes, tweaks, hurrah!
Ah, it’s not on the public side. Then the easiest will be to replace image(...)
with
thumbnail(array("thumbnail" => false, "id"=>$item["image"], "loading"=>"lazy"))
Presumably, taghandlers.php
is already included in the plugin’s code.
Offline
Re: Feedback: Textpattern CMS 4.8.7 released: bug fixes, tweaks, hurrah!
Yes, the tag is used in a function on the admin side and also in another public function. Will try the thumbnail variant, thanks!
Offline
Re: Feedback: Textpattern CMS 4.8.7 released: bug fixes, tweaks, hurrah!
Given the fact that we allow tags in the admin side on the ‘Start’ tab (and plugins can do so if they make dashboards) is there mileage in moving processTags()
and other related public-tag-processing functions somewhere else? Like taghandlers.php or txplib_misc.php? That means plugin authors only need to include one extra file if they want to add front-end tag handling functionality in their code, instead of two.
I’m not sure if it’s worth it, given these are edge cases, but I’m throwing it out for discussion. Guess it depends if we ever move to OO tag handling. If we do that, people will get the tag processing functionality for “free” everywhere courtesy of the class loader. At the expense of the potential performance degradation that comes with class-based tomfoolery.
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
Online