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

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Post Reply
harikaram
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Tue Nov 06, 2007 7:46 pm

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

Post by harikaram » Mon Jan 07, 2008 10:51 am

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...
http://www.RegallyGraceful.com
Spiritual Perspective, Practical Outlook, Professional Experience

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

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

Post by infograf768 » Mon Jan 07, 2008 11:32 am

Moving to 1.5 Template overrides.
Thanks for the tip.  :)

Topic made sticky.
Last edited by infograf768 on Mon Jan 07, 2008 11:42 am, edited 1 time in total.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

herb200mph
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3592
Joined: Sun Jun 25, 2006 12:12 am
Location: Salisbury, NC/USA (N. of Charlotte)
Contact:

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

Post by herb200mph » Sat Feb 16, 2008 5:54 pm

What is the specific result/display this modification creates? Can you provide a link or screen shot example?
Author: Joomla! 5: Boots on the Ground, Volume 1 @ Amazon.com
Author: Joomla! 4: BASIC TRAINING - Boots on the Ground @ Amazon.com
Joomla! Magazine - https://magazine.joomla.org/all-issues/ ... c-training

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

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

Post by infograf768 » Sun Feb 17, 2008 9:53 am

I guess it could provide for e-mail cloaking for example in a description.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

harikaram
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Tue Nov 06, 2007 7:46 pm

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

Post by harikaram » Sun Feb 17, 2008 11:05 am

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)

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

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

Post by infograf768 » Sun Feb 17, 2008 5:22 pm

@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.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

fedefil
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Feb 11, 2008 7:32 am

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

Post by fedefil » Fri Feb 22, 2008 9:26 am

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.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

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

Post by infograf768 » Fri Feb 22, 2008 12:29 pm

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/
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

harikaram
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Tue Nov 06, 2007 7:46 pm

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

Post by harikaram » Tue Jun 24, 2008 3:54 pm

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.
http://www.RegallyGraceful.com
Spiritual Perspective, Practical Outlook, Professional Experience

justbrock
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Mar 06, 2008 12:22 am

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

Post by justbrock » Mon Jul 21, 2008 10:47 pm

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:

nono_kaki
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Tue Apr 14, 2009 8:16 am
Location: Makassar, Indonesia
Contact:

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

Post by nono_kaki » Mon Jun 01, 2009 1:26 pm

Useful topic, dude...

Status subscribe... :D :D

User avatar
Britta Leuchner
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Tue Oct 28, 2008 7:19 pm

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

Post by Britta Leuchner » Wed Jun 17, 2009 8:37 pm

Yes, still useful!
I think so too. Great! Thanks to all for sharing ....
http://www.digidog.de | graphics art work, design, post production, motion pictures, web scenarios, cms and framework implementation

Journalforum
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Aug 28, 2009 6:07 pm

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

Post by Journalforum » Fri Sep 04, 2009 5:43 pm

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.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

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

Post by infograf768 » Sat Sep 05, 2009 3:14 pm

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.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

modhumiah
Joomla! Intern
Joomla! Intern
Posts: 56
Joined: Wed Feb 24, 2010 2:14 am

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

Post by modhumiah » Sun Mar 07, 2010 3:29 pm

It was very usefull. Thanks for sharing.

User avatar
magiclogix
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Tue Mar 23, 2010 3:51 am
Location: Dallas, TX
Contact:

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

Post by magiclogix » Tue Apr 06, 2010 3:46 pm

Thanks for the post. We'll be using this soon.
Hassan Bawab is the CEO of Magic Logix, a digital marketing agency. Magic Logix combines dynamic website development, professional website design, SEO & integrated social media marketing to drive new leads with high conversion.

petergadget
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Fri Jun 11, 2010 9:32 pm

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

Post by petergadget » Sun Jul 11, 2010 6:57 pm

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

dacharles
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Mon Aug 23, 2010 7:42 am

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

Post by dacharles » Thu Sep 02, 2010 8:56 am

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

f1b0n4cc1
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Fri May 28, 2010 4:10 pm
Contact:

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

Post by f1b0n4cc1 » Sun Oct 31, 2010 7:20 pm

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
Please read forum rules regarding signatures: http://forum.joomla.org/viewtopic.php?t=65

merois
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Dec 29, 2010 4:26 pm

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

Post by merois » Fri Dec 31, 2010 12:21 am

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...

pauleffah
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri Jun 03, 2011 12:22 pm

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

Post by pauleffah » Fri Jun 03, 2011 12:46 pm

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


Post Reply

Return to “Templates for Joomla! 1.5”