Page 1 of 1

[TIP] Template Overide to Run Content Plugins on Category De

Posted: Mon Jan 07, 2008 10:51 am
by harikaram
I've added some code to my category blog template override that runs the content plugins on the category description. Just thought I'd share:

File: /template/[mytemplate]/html/com_content/category/blog.php page...

Code: Select all

	// Hack to run content modules on cat description
	$article =& new JObject();
	$article->text = $this->category->description;
	$dispatcher	   =& JDispatcher::getInstance();
	
	JPluginHelper::importPlugin( 'content' );
	$results = $dispatcher->trigger('onPrepareContent', array (& $article, array(), 0));
	
	$this->category->description=  $article->text; 
Hope this helps someone...

Re: [TIP] Template Overide to Run Content Plugins on Category Description

Posted: Mon Jan 07, 2008 11:32 am
by infograf768
Moving to 1.5 Template overrides.
Thanks for the tip.  :)

Topic made sticky.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Sat Feb 16, 2008 5:54 pm
by herb200mph
What is the specific result/display this modification creates? Can you provide a link or screen shot example?

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Sun Feb 17, 2008 9:53 am
by infograf768
I guess it could provide for e-mail cloaking for example in a description.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Sun Feb 17, 2008 11:05 am
by harikaram
Exactly or geisha or {loadmodule user1}. Normally content plugins only run on the article text and not on the category and section description. This override runs them on an arbitrary piece of text (section description in the case of the example above)

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Sun Feb 17, 2008 5:22 pm
by infograf768
@harikaram

If you could find a way —without hacking core— to be able to use Content plugins in HTML Modules (the former Custom Modules in 1.0.x), this would be a real help for a lot of users as this is impossible as of now.
Many people use this in 1.0.x and migrating is a nightmare for them.
There would be a performance hit, but it is worth it IMO.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Fri Feb 22, 2008 9:26 am
by fedefil
Jean-Marie, maybe you passed up my recent post: http://forum.joomla.org/viewtopic.php?f=469&t=264545
You'll find the solution you are looking for there.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Fri Feb 22, 2008 12:29 pm
by infograf768
GREAT indeed. ;)
Ian has also released since a Custom Content module overpassing the limitation of the HTML module.
This can replace easily the custom module by loading an Article. And as we all know, articles do accept content-plugins...

See:
http://extensions.joomla.org/component/ ... Itemid,35/

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Tue Jun 24, 2008 3:54 pm
by harikaram
infograf768. funny you mention this. I just found this post again searching joomla site for a solution to this issue. Along the way I found a forum post from back at J1.0.0 about people complaining that J1.0.? turned ON content plugins for modules. The developers claimed that it was just sensible that it should be this way so ironic that it has been reverted. Perhaps a module option would be nice??

The custom module plugin is great. Thank you very much, fedefil.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Mon Jul 21, 2008 10:47 pm
by justbrock
Thank you for this post! I have been scouring the web trying to find a way to allow the same function in the com_contact category description. I should have looked here first! This hack works beautifully! No changes were necessary.

In case you might be asking, "why would I need to do this?" My usage will be to incorporate the Contact Information Module 2.2 from http://www.digitalgreys.com/ to allow me to show a location address (and image) in the header of my contacts list of a specified category. Basically, I wanted to be able to show the location information and not have to add it to every contact record of that location.

Thanks again! Works like a charm! :laugh:

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Mon Jun 01, 2009 1:26 pm
by nono_kaki
Useful topic, dude...

Status subscribe... :D :D

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Wed Jun 17, 2009 8:37 pm
by Britta Leuchner
Yes, still useful!
I think so too. Great! Thanks to all for sharing ....

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Fri Sep 04, 2009 5:43 pm
by Journalforum
pls who understand what this mean. This is what the page display each time I click on ijoomla news icon inside my components on adminstrator control panel

Site error: the file /home/content/a/f/r/africannewsliv/html/administrator/components/com_news_portal/admin.news_portal.php requires the ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Sat Sep 05, 2009 3:14 pm
by infograf768
Journalforum wrote:pls who understand what this mean. This is what the page display each time I click on ijoomla news icon inside my components on adminstrator control panel

Site error: the file /home/content/a/f/r/africannewsliv/html/administrator/components/com_news_portal/admin.news_portal.php requires the ionCube PHP Loader ioncube_loader_lin_5.2.so to be installed by the site administrator.
This has nothing to do with the original topic.

You are using an encrypted component called com_news_portal which requires a specific php script called Ioncube to run. You better talk with whoever sold you this component.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Sun Mar 07, 2010 3:29 pm
by modhumiah
It was very usefull. Thanks for sharing.

Re: [TIP] Template Overide to Run Content Plugins on Category De

Posted: Tue Apr 06, 2010 3:46 pm
by magiclogix
Thanks for the post. We'll be using this soon.

Re: [TIP] Template Overide to Run Content Plugins on Categor

Posted: Sun Jul 11, 2010 6:57 pm
by petergadget
perfect, exactly what I was looking for. However - I am not sure where to exactly place this? Can someone please give me a hint? doesn't work by placing at the beginning ...

Thanks

Peter

Re: [TIP] Template Overide to Run Content Plugins on Categor

Posted: Thu Sep 02, 2010 8:56 am
by dacharles
petergadget wrote:perfect, exactly what I was looking for. However - I am not sure where to exactly place this? Can someone please give me a hint? doesn't work by placing at the beginning ...

Thanks

Peter
Depend on what template you are using, Some template may need to create your folder in your template file first: html/com_content/category/blog.php

Re: [TIP] Template Overide to Run Content Plugins on Categor

Posted: Sun Oct 31, 2010 7:20 pm
by f1b0n4cc1
componenets such as sh404sef for seo caused any problem ? because it change link automatically to html as you know . when the way changed maybe has problem in future articles . such as when we post something , and need to change topic again , it not change link , because it just optimize it in article id

Re: [TIP] Template Overide to Run Content Plugins on Categor

Posted: Fri Dec 31, 2010 12:21 am
by merois
harikaram wrote:I've added some code to my category blog template override that runs the content plugins on the category description. Just thought I'd share:

File: /template/[mytemplate]/html/com_content/category/blog.php page...

Code: Select all

	// Hack to run content modules on cat description
	$article =& new JObject();
	$article->text = $this->category->description;
	$dispatcher	   =& JDispatcher::getInstance();
	
	JPluginHelper::importPlugin( 'content' );
	$results = $dispatcher->trigger('onPrepareContent', array (& $article, array(), 0));
	
	$this->category->description=  $article->text; 
Hope this helps someone...

Re: [TIP] Template Overide to Run Content Plugins on Categor

Posted: Fri Jun 03, 2011 12:46 pm
by pauleffah
Guys pls help me out on this topic. I get this when installing templates.

"Error! Could not find an XML setup file in the package" via the link below

viewtopic.php?f=469&t=625543