Plugin override

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.
User avatar
Devil
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Sat Aug 20, 2005 2:18 pm
Location: Localhost @ Ruhrgebiet
Contact:

Plugin override

Post by Devil » Wed Dec 12, 2007 9:20 pm

Hi,

i have some "trouble" to understand this:

The plugin pagebreak.php can be override and the plugin pagenavigation.php can´t override  ???

Where is my mistake?
mfg Devil


http://www.joomla-aktuell.de - Joomla-Aktuell - a German Joomla News Site

 
psifidotos
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Oct 23, 2007 4:20 pm

Re: Plugin override

Post by psifidotos » Sat Dec 22, 2007 1:55 am

hello, I have the same problem but in my case I haven't find a way
to override plugins at all. how did you manage to override
pagebreak.php ?

Michail

Chrissy
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Nov 15, 2007 11:52 am

Re: Plugin override

Post by Chrissy » Mon Dec 24, 2007 1:04 am

Hi

I have the same problem with pagebreak.php.
(I haven't tried to override any other plugins yet.)

Please someone.

User avatar
tomgreever
Joomla! Intern
Joomla! Intern
Posts: 79
Joined: Wed Nov 14, 2007 5:52 pm

Re: Plugin override

Post by tomgreever » Sat Jan 05, 2008 1:52 am

Yes, me too. How can we override pagebreak.php?

User avatar
Devil
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Sat Aug 20, 2005 2:18 pm
Location: Localhost @ Ruhrgebiet
Contact:

Re: Plugin override

Post by Devil » Sat Jan 05, 2008 11:51 am

Hi,

take a look in 68Portal Template from the Template Contest to see pagebreak override works
mfg Devil


http://www.joomla-aktuell.de - Joomla-Aktuell - a German Joomla News Site

User avatar
tomgreever
Joomla! Intern
Joomla! Intern
Posts: 79
Joined: Wed Nov 14, 2007 5:52 pm

Re: Plugin override

Post by tomgreever » Sat Jan 05, 2008 1:07 pm

Thanks. It looks like 68Portal has a pagebreak.php file in the html folder. But other than that, is there anything else special? I put his pagebreak.php file in my html folder and it doesn't change. I even altered the HTML to make it look different, but my template is still using the default.

Anything else I am supposed to do?

User avatar
tomgreever
Joomla! Intern
Joomla! Intern
Posts: 79
Joined: Wed Nov 14, 2007 5:52 pm

Re: Plugin override

Post by tomgreever » Sat Jan 05, 2008 1:29 pm

There is another pagebreak.php file in the con_content folder. But from looking at both pagebreak.php files, I would guess one is working and the other is not, as they look redundant. But either way, placing these files in my template does not override the default pagebreak.

Chrissy
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Nov 15, 2007 11:52 am

Re: Plugin override

Post by Chrissy » Sun Jan 06, 2008 9:09 am

Hi again

Im starting to get frustrated.

All i want to do is to change the two >> in the links in to a single ».
I have changed all the othyer >> on the site without problem.

Im sure its not suppose to be this complicated.  :'(

zANavAShi
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 102
Joined: Sat Sep 09, 2006 2:26 pm
Location: Aotearoa

Re: Plugin override

Post by zANavAShi » Mon Jan 28, 2008 5:39 am

Chrissy wrote: Hi again

Im starting to get frustrated.

All i want to do is to change the two >> in the links in to a single ».
I have changed all the othyer >> on the site without problem.

Im sure its not suppose to be this complicated.  :'(
What she said! This is what I want to do also.

Surely somebody must be able to offer a working solution to this please?

Cheers,
Zana

azazelraw
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Tue Mar 04, 2008 5:02 pm

Re: Plugin override

Post by azazelraw » Wed Mar 19, 2008 11:12 pm

I'm not sure if this is what you are looking for, but if you want to alter the symbols for the "previous" and "next" (i.e < and >) you can change it in /site_root/plugins/content/pagenavigation.php

if you change "&gt" (>) to "&raquo" (») on line 196 (. JText::_( '&gt' ) .) it should do the trick. It worked for me anyways.

*EDIT

Hi again... I just learned about template override today hehe, so maybe my previous answer wasn't really what you guys where looking for (as it changes the core files).

Now that I understand a little bit about the template override, I too am wondering WHERE/HOW can I override the plugins?? I changed the pagenvigation file to get the prev and next links without the "<" ">" and have images instead. And it works just fine... but it seems more optimal to just have an override of this (rather then having to redo this (remember what I changed)) if I need the same template on a new server or something similar. I can override the modules and components, but I can't get the pagenavigation to change (without changing the core file).

Is there anyone who has succesfully overriden a plugin? If so, would you minde sharing how? I've tried putting it in the html folder (_root/templates/mytemplate/html), this did nothing. I also tried creating a folder called "plugins" and put said file in there (_root/templates/mytemplate/html/plugins), didn't work either. Any other ideas?

nassoit
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Fri Jan 25, 2008 11:16 pm

Re: Plugin override

Post by nassoit » Tue Jun 17, 2008 9:11 pm

I recognize that this topic is a bit old, but...

I'm looking to override plugins as well. And I haven't found any info at all that indicates whether this is even possible. Anyone else have better luck?

kadded
Joomla! Explorer
Joomla! Explorer
Posts: 306
Joined: Sun Mar 23, 2008 9:54 pm

Re: Plugin override

Post by kadded » Thu Aug 14, 2008 2:35 am

Same here, I would love to override plugins but there seems to be no way to actually doing this.

Does anyone have an idea on how to.
I checked the template one referred to, and it showed that the plugin override was simply put in the HTML folder of the template. Doing this with eg vote.php did not work for me. Did I make a mistake or is it simply not possible? If so, I will d a feature request since in my case this would be useful really.

Any comments more than welcome, since I really hate to do core hacks.

rjo
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Wed May 23, 2007 7:37 pm

Re: Plugin override

Post by rjo » Sun Sep 14, 2008 12:51 am

Hello, you may also want to check out this tutorial:
http://forum.joomla.org/viewtopic.php?f=304&t=305657

What you did in pagenavigation.php can be done in the template override pagination.php as well.
HTH

rexkramer
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu Jan 03, 2008 12:06 pm

Re: Plugin override | Page Navigation with Title

Post by rexkramer » Tue Sep 23, 2008 5:43 pm

PageNav with Title Display
http://www.eboga.org/cms/joomla/page-navigation.html

Is this possible with Overrides?
Is this too much additional code, cause overrides do mostly cosmetics?!?

TIA!

rjo
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Wed May 23, 2007 7:37 pm

Re: Plugin override | Page Navigation with Title

Post by rjo » Tue Sep 23, 2008 10:14 pm

Hello,
You are right. When I wanted to display the next/previous article title I also had to modify the core pagenavigation.php.

The pagination.php override works because the core pagination.php itself is set up to check for an override.

It would be good to have a similar check within core pagenavigation.php as well.

The following core modification would do :
(this may certainly be made more elegantly, and of course, since you first modify the core file, you could do all other changes here right away ;-)

Code: Select all

...
$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagenavigation.php';
if (file_exists($chromePath))
	require_once ($chromePath);

if (!function_exists('plgContentNavigation')) {
		function plgContentNavigation( &$row, &$params, $page=0 )
		{
//...
		}
	}

//move this to the end to ensure the function is available:
$mainframe->registerEvent( 'onBeforeDisplayContent', 'plgContentNavigation' );
and in the template override pagenavigation.php do not register the event again or you will get double navigation ;-)
rexkramer wrote:PageNav with Title Display
http://www.eboga.org/cms/joomla/page-navigation.html

Is this possible with Overrides?
Is this too much additional code, cause overrides do mostly cosmetics?!?

TIA!

rexkramer
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu Jan 03, 2008 12:06 pm

Plugin override | pagination.php | pagenavigation.php differ

Post by rexkramer » Wed Sep 24, 2008 10:02 am

The pagination.php override works because the core pagination.php itself is set up to check for an override. It would be good to have a similar check within core pagenavigation.php as well.
Thank you for your investigations! Makes sense.
Maybe this missing feature should be submitted to the core-developers...
CU

deleted user

Re: Plugin override

Post by deleted user » Thu Oct 23, 2008 12:16 am

There is a lot of misleading information and confusion in this thread due to some confusing and inconsistent naming conventions in the Joomla core. I hope I have sorted it out for myself correctly here.

In the YOURTEMPLATE/html folder for overrides, a file called "pagination.php" will override the core content plugin called "pagenavigation." This plugin provides pagination for the front page and section/category pages ONLY. It DOES NOT affect the previous/next article navigation on individual articles.

The table of contents within paginated articles is generated by the core content plugin called "pagebreak." In the 68Portal template mentioned in this thread there appear to be two pagebreak overrides, both named "pagebreak.php." One is in the TEMPLATE/html folder and one is in TEMPLATE/html/com_content/article/. THEY DO NOT WORK.

With 68Portal in Joomla 1.5.7 the pagebreak overrides have no effect and there is only raw output for the article table of contents. I have the same problem with another early 2008 template, so it may be a problem with certain templates and recent versions of Joomla.

Efedro
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Fri Oct 24, 2008 7:15 am
Location: Russia
Contact:

Re: Plugin override

Post by Efedro » Fri Oct 24, 2008 7:23 am

dpk wrote:With 68Portal in Joomla 1.5.7 the pagebreak overrides have no effect and there is only raw output for the article table of contents. I have the same problem with another early 2008 template, so it may be a problem with certain templates and recent versions of Joomla.
But why? May be it's some kind of bug?
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

rjo
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Wed May 23, 2007 7:37 pm

Re: Plugin override

Post by rjo » Fri Oct 24, 2008 3:49 pm

Efedro wrote:
dpk wrote:With 68Portal in Joomla 1.5.7 the pagebreak overrides have no effect and there is only raw output for the article table of contents. I have the same problem with another early 2008 template, so it may be a problem with certain templates and recent versions of Joomla.
But why? May be it's some kind of bug?
Hello,
As mentioned above, the core pagination.php checks for an override, the core pagenavigation.php does not.

IMHO an enhancement of the core should include two things:
A) core pagenavigation.php should permit an override by the template just as pagination.php already does.
B) core pagenavigation.php should by default also retrieve the title of the next/previous article.

Enhancement A) would make life easier for template designers (and allow to invent things we have not discussed here).

Enhancement B) would be great for general usability:
Since we know that there is a "next" article, it would be reasonable to also show the article's title to the website visitor, at least as a tooltip.
Right now, the visitor has no indication of what the next article may contain and must follow the link to find out.
It would be more user friendly if the website visitor had at least an indication of what to expect.

Solutions to both items do actually exist. Does anybody know the procedure how to suggest this to the core team?

Thanks

deleted user

Re: Plugin override

Post by deleted user » Fri Oct 24, 2008 4:19 pm

Procedures....

There is really only one effective procedure for getting things done in a large organizational context:

1) Have a very solid idea.
2) Articulate it clearly and succinctly.
3) Make sure it is communicated directly or indirectly to a key decision maker--it helps to "know people."
4) Make sure the benefits are clear and coincide with the decisionmakers' values, goals, interests, general way of seeing things, etc.
5) Follow the official procedures as well, but not as a "cold call."
6) Do not whine, complain, harass, or cajole others but perform all necessary followup.

So one thing to do is to hash this idea out a little more and then maybe float it to some prominent template designers who may have good connections. If you get "experts" to back you, it suggests you have a good goal with a likelihood of success.

User avatar
morktron
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 164
Joined: Sun Aug 27, 2006 7:28 am
Location: Ballina, New South Wales, Australia
Contact:

Re: Plugin override

Post by morktron » Mon Feb 09, 2009 5:01 am

Great posts everyone. I hope this gets done for J1.5.9, it's terrible to see tables again for my individual articles!

Code: Select all

<table class="pagenav" align="center">
<tbody>
<tr>
<th class="pagenav_prev">
<a href="url-here">< Prev</a>
</th>
<td width="50">   </td>
<th class="pagenav_next">
<a href="url-here">Next ></a>
</th>
</tr>
</tbody>
</table>
from my humble understanding of this thread I see that it is not possible to override the pagination for individual articles without having to modify the core?

deleted user

Re: Plugin override

Post by deleted user » Mon Feb 09, 2009 3:03 pm

No, you should be able to override everything the core puts out with template overrides in the active template directory.

psifidotos
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Oct 23, 2007 4:20 pm

Re: Plugin override

Post by psifidotos » Sun Mar 01, 2009 7:26 pm

Well, I searched all the code in joomla libraries and plugin override is not supported...

I am attaching a new helper.php file (JPluginHelper) that must replace helper.php in directory
libraries/joomla/plugin ( I have added about 6 lines of code in _import function). Copy the new file in directory libraries/joomla/plugin and dont forget to rename it to helper.php from helper.php.txt

I am going to send the new file for verification in joomla developers but i dont know if anything is going to be updated in the near future... for example templatechooser extension is still not working by default.

Well, if you use the new file, joomla is going to search first in your template to find the plugins file in directory <template>/html/plugins/

for example if you want a new pagebreak.php (like me :)), I copied the original file
/plugins/content/pagebreak.php

and put it into the folder

<yourtemplate>/html/plugins/content/pagebreak.php

after that you can make all the changes you want. Joomla is using pagebreak.php from your template...

You can try the new file, but please be very careful I havent tested a lot....
You do not have the required permissions to view the files attached to this post.

User avatar
kozaki
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Mar 12, 2008 1:06 pm
Location: France, UE
Contact:

Re: Plugin override

Post by kozaki » Sun Apr 12, 2009 5:23 pm

thank you all for having pointed out this feature.
psifidotos 7-lines hack is working great in this location (J-1.5.10) :D
Just hope it will be included in the Core when tested enough.

yury_z
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 16, 2009 1:52 pm

Re: Plugin override

Post by yury_z » Wed Apr 29, 2009 2:21 pm

Hi?

Any testing done regarding the reliability of psifidotos' hack?

10x

no64
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sun Dec 23, 2007 9:38 am

Re: Plugin override

Post by no64 » Tue Dec 08, 2009 3:05 pm

@ psifidotos

...can you post your core hack again, please?
I'm not able to download your attached file - doesn't exist anymore.

User avatar
piotr_cz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 164
Joined: Mon Mar 30, 2009 11:27 am
Location: Europe
Contact:

Re: Plugin override

Post by piotr_cz » Wed Dec 16, 2009 1:48 am

@ psifidotos
I'm getting same error: The selected attachment does not exist anymore.

did anybody submit a white paper? would be cool to have it in J! 1.6

RAGEDBULL
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 164
Joined: Wed Jun 21, 2006 2:50 am

Re: Plugin override

Post by RAGEDBULL » Tue Jun 01, 2010 6:39 am

I had a whacky kind of an idea, and I wanted to know if anyone else has though of this or tried it before I go ahead.

So, layout overrides only refer to template layouts (templates) from views - which do not exist in plugins.

I can imagine some cases where another plugin could edit the output of another plugin, since you can control layout execution. For example, one plugin renders a certain output, shouldn't another plugin executed afterwards be able to then modify this output. Not as elegant as an override, but a possible solution. I forgot why I originally wanted to do a plugin override, but I wish they where MVC with views - though in 1.5 when half the core components aren't MVC why bother adding in a MVC layer for plugins?

User avatar
piotr_cz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 164
Joined: Mon Mar 30, 2009 11:27 am
Location: Europe
Contact:

Re: Plugin override

Post by piotr_cz » Tue Jun 01, 2010 7:54 am

What I usually do is that I clone the plugin to prevent the overrides of new Joomla upgrades.
If it's 3rd party and not updated anymore, I change it directly.

Of course MVC approach would be much better and in Joomla 1.6 plugins have at least it's own directories but then MVC for plugins could be implemented soonest in 1.7.

psifidotos
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Oct 23, 2007 4:20 pm

Re: Plugin override

Post by psifidotos » Thu Jan 20, 2011 6:41 pm

Hello,

I have just got an email that told me that there is still interest about that hack... I want to apologize, I didn't even know that there was such a conversation....

Thanks to Mr.Tom Chevous that found me through opendesktop I am going to upload it again...

Notice1: The code has not been reviewed officially from the joomla developers... So you can use it by taking your own risks... I am using it in one of my sites and is working...
Notice2: If you make an update in your site there is chance that helper.php will be overwritten so you have to make again the procedure...

With Regards,

Michail Vourlakos (psifidotos)

PS: I had even forgot that I had wrote it :), it took me half an hour to reimplement it because I couldnt find it and suddenly after an hour of search i found it hidden in one of my backups, I tweaked it a bit and here it is ... :)
So 2 years after, hello to everyone... :)
You do not have the required permissions to view the files attached to this post.

 

Locked

Return to “Templates for Joomla! 1.5”