I have made (copy 'n' pase code) function and place in the plugs folder. Which is working great. Basic it making sure all urls, phones numbers are clickable and removes all emty html tags from content been given and other stuff. I noiced that WYSIWYG editors don't aways make the links clickable especially if they been copying and pase content from else where. (removing empty tags coming soon)
In the html I have the header
{content assign='capturedcontent'}
in the main body
{pagecleaner clean=$capturedcontent}
I want to know what is the best way to cache this so its don't load every page load.
I did look at this page https://docs.cmsmadesimple.org/general- ... g-in-cmsms I am bit lost.
I guess if you did this {capture assign='mycontent'}{pagecleaner clean=$capturedcontent}{/capture} that wouldn't cache it.
Sorry I am not been clear. Baiscy I want the content to be cache made by my pagecleaner.
The code I am using is from
https://github.com/kwi-dk/UrlLinker
you welcome to look at my messy function Please don't laugh at me. I don't know much about php programing.
Thanks guys.
I am confused about caching.
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
I am confused about caching.
- Attachments
-
- function.pagecleaner.php.zip
- (5.93 KiB) Downloaded 189 times
Re: I am confused about caching.
Consider checking the Event manager and put your code in a UDT.
ContentEditPre could be the right event to connect it to.
ContentEditPre could be the right event to connect it to.
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: I am confused about caching.
Yes I know that would be the best route to use ContentEditPre and I have considered it but I can't find anything how to use ContentEditPre with UDT
I don't know how to call string (page, news or cal Content) that been submit and then save to the database after.
I would need a example of code of Getting page Content after been submited and the code to save it the to database. Without that I am dead in the water with ContentEditPre.
Me using ContentEditPre would be amzing as I would able to put lot more stuff in the code to clean up and adding filers to the Content been submited.
I don't know how to call string (page, news or cal Content) that been submit and then save to the database after.
I would need a example of code of Getting page Content after been submited and the code to save it the to database. Without that I am dead in the water with ContentEditPre.
Me using ContentEditPre would be amzing as I would able to put lot more stuff in the code to clean up and adding filers to the Content been submited.
-
- Forum Members
- Posts: 155
- Joined: Thu Aug 20, 2020 10:49 pm
Re: I am confused about caching.
Did try find this from other post few years ago i well try use with ContentEditPre
I hope this code works
How would I do it for the news content?
And thank you
I hope this code works
Code: Select all
$content_obj =& $params['content'];
$text = $content_obj->GetPropertyValue('content_en');
$text = $content_obj->SetPropertyValue('content_en',$text);
$text = $content_obj->GetPropertyValue('myblock');
$content_obj->SetPropertyValue('myblock',$text);
And thank you