Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2021-07-23 10:12:00

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 295
Website GitHub Twitter

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

#14 2021-07-23 10:24:14

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 295
Website GitHub Twitter

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

#15 2021-07-23 11:08:54

etc
Developer
Registered: 2010-11-11
Posts: 4,512
Website GitHub

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

#16 2021-07-23 11:15:01

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 295
Website GitHub Twitter

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

#17 2021-07-23 11:40:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,516
Website GitHub

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

Offline

Board footer

Powered by FluxBB