Third party plugin not override in joomla - plugins

I have created a search plug-in in joomla that is "my-plug-in". When i tried to override this plug-in in joomla templates its not working.If i try to override any existing plug-in joomla its working. I have checked below link as well. This is working
This link
How i override my plug-in in joomla template.
I have added my plug-in below place.
plugins/search/my-plug-in
to
templates/{TEMPLATENAME}/html/plg_search_my-plug-in

If you have thoroughly checked the link that you have given you will find a line "However you can only do it if the plugin is ready to allow overrides. "
and
Joomla provides a mechanism to override a plugin but this feature is not supported by all the plugins. Right now the only plugin in Joomla 3.x core that allow overrides is the Pagenavigation Content plugin that shows previous/next article links in article view of content component. There may be other plugins from third party developers allowing it and more core plugins will be overridable in the future.
Do you have a tmpl folder inside your plugin as quoted here "You will know when a plugin is overridable because has a /tmpl/ folder in it. "
Also have you used JPluginHelper::getLayoutPath(). These are the requirements that need to be completed before you override layouts.
Check this code in pagenavigation plugin
// Output.
if ($row->prev || $row->next)
{
// Get the path for the layout file
$path = JPluginHelper::getLayoutPath('content', 'pagenavigation');
// Render the pagenav
ob_start();
include $path;
$row->pagination = ob_get_clean();
$row->paginationposition = $this->params->get('position', 1);
// This will default to the 1.5 and 1.6-1.7 behavior.
$row->paginationrelative = $this->params->get('relative', 0);
}
They have used JPluginHelper::getLayoutPath(); and you have to use
$path = JPluginHelper::getLayoutPath('search', 'my-plug-in');
You can check the pagenavigation plugin thoroughly to get a good idea.

Related

TypoScript: Check if JS/CSS File is already included

anybody knows how to check if a js/css file is already included with typoscript?
Example
[Template_A.ts]
page.includeJS {
jsfile = fileadmin/Template/js/jquery-1.10.2.min.js
}
now if i got an extension with the same include e.g.
[Extension_A.ts]
page.includeJS {
jsfile = fileadmin/Template/js/jquery-1.10.2.min.js
}
Is there a way to prevent this kind of double code injection? Maybe i got another Template e.g. Template_B.ts where jquery is not included - than the Extension_A.ts has to include jquery by itself.
Kinldy
You can use the same key inside includeJS such it just gets overridden if you include the file twice.
Other than that you should put jQuery into includeJSlibs, such that it is loaded before the other JS files.
Other than that, the TS should be unique for each page. Therefore you always to make sure anyway that all resources are included in-order.
You should not include JS libs with the automatic extension TS setups. Use your documentation to tell the integrator what needs to be included and what not.
The various and independent inclusion of scripts by plugins and templates is one of the tricky points in TYPO3. As far as I know, this point cannot be managed at one single point.
There is a plugin "t3jquery" that offers to build, compress and share a common jQuery library. It also has a service to analyze other plugins for their dependencies. But this doesn't solve the problem in general, as many plugins don't check for libraries already loaded.
The most stable way is to remove all plugin's references to libraries manually in your TypoSkript. This gives you some simple additional TypoSkript lines. I use lines like these:
plugin.tx_imagecycle_pi1.file.jQueryLibrary >
plugin.tx_imagecycle_pi1.jQueryLibrary >
plugin.tx_multicontent_pi1.file.jQueryLibrary >
plugin.tx_multicontent_pi1.jQueryLibrary >
# Fluid
page.headerData.998 >
You can find the matching TypoSkript descriptors by searching for the library name in the TypoSkript browser or by greping in the plugin's source code. You will also need this if you wish to add libraries as part of content that was get by AJAX, thus separating the libs from the page content.
Here's a tut (in German): http://jweiland.net/typo3/typoscript/javascript-manuell-entfernen-oder-einbinden.html
Futher possibilities you can check:
Some plugins are written in good structure and offer to keep back their Javascript in the settings.
Some script inclusions may come rather from the static template but from a plugin, so don't forget to have a look there.

Enable searching //TODO tags in *.module extension file

I wanted to use // TODO tags in drupal file "*.module".
I've activate the searching for task tag(content types are:
"css,html,DTD,XML").
The *.module extension is associate with the drupal module extension.
I've check the "configure contents" of the search filtering from "Task view".
Tags for php comments are; Fixme, #todo, TODO(Default).
There's something missing??
You can use Drupal plug-in for Eclipse IDE by XTND.US. Update site: http://xtnd.us/downloads/eclipse
With this plugin installed and working, you should see TODO highlighted in your code and *.module files should be opened as php. All todo should appear in Tasks Eclipse view.

How can I access which files the user currently has open from an eclipse plugin?

I'm very new to eclipse plugin development, and frankly to eclipse itself. I am trying to find a way to access a list of which files are currently being worked on by the user, and possibly even more specifically, what part of these files (which class, method, block of code, etc.).
I am thinking that I would like to have the plugin grab information on which files are currently open in the tabs, and then go from there, but I can't even figure out how to do this. I've been searching the eclipse documentation at help.eclipse.org, but I still haven't found anything useful for what I want to do. Does anyone have any ideas?
Try the following code:
IWorkbenchPage[] pages = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getPages();
for (IWorkbenchPage page : pages) {
IEditorReference[] references = page.getEditorReferences();
for (IEditorReference reference : references) {
IEditorInput input = reference.getEditorInput();
}
}
You should be able to walk your way from the workbench to a workbench page (IWorkbenchPage), which as a findEditors method.

Where to find the Wicket Stuff annotation package?

Where I can find wicketstuff-annotation.jar? It's used to be available at least in a Maven repo at http://wicketstuff.org/maven/repository but that doesn't exist anymore, and the Wicket Stuff homepage is not very helpful either.
Specifically, I need org.wicketstuff.annotation.mount.MountPath because I want readable URLs in my Wicket app and find annotations an elegant way to mount pages. (I wonder why this kind of stuff isn't included in core Wicket distribution...)
(Any place to download the jar from would be fine; I don't use Maven in current project.)
You can just mount your pages anywhere in your application, typically in your Application's init() method, like:
#Override
protected void init() {
mountBookmarkablePage("/users", UsersPage.class);
}
That said, if you want to use the annotations package, it is available from Maven Central
Update from Wicket 1.5:
You should use the method mountPage() instead of mountBookmarkablePage() as that method has been removed from Wicket 1.5.
#Override
protected void init() {
mountPage("/users", UsersPage.class);
}
https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
This is the URL. You can click on Binary link to download the required jar.
A community user today contributed an upgrade of the library to Wicket 1.5, so it will be available for next release (1.5-RC6). Until then the users of 1.5 can use it from Github repo.

Disable Installed Software & Installation History tab on Help | About | Installation Details

Is there some way I can suppress or disable the "Installed Software" & "Installation History" tabs on Help | About | Installation Details button in a RCP?
I'm not using P2 for this particular application so there will never be any history and the installed software tab has no content.
If you do not want these do show then make sure that the following plug-ins are not deployed in your application's target platform:
org.eclipse.p2.ui
org.eclipse.p2.ui.discovery
org.eclipse.p2.ui.sdk
org.eclipse.p2.ui.updatechecker
Strictly speaking you only really need to remove the first bundle in the above list as the subsequent bundles depend on the core ui bundle. Typically, if I do not want the user to shcedule updates etc. I'll only inlcude the first bundle above. I then build a custom UI around p2 functionality whilst re-using some of the provided core p2 UI API (but without auto-scheduling UI etc. included).
If you want to remove the preference pages for the p2 sheduling/updates, then in your in your WorkbenchAdvisor you can use write the following in the postStartup() method:
PreferenceManager pm =
PlatformUI.getWorkbench(
).getPreferenceManager();
pm.remove("org.eclipse.equinox.internal.p2.ui.sdk.ProvisioningPreferencePage"); pm.remove("org.eclipse.update.internal.ui.preferences.MainPreferencePage");
I ended up deleting the org.eclipse.p2.ui plugin's & features from my built product.
Not the most elegant solution, but it works.
subclass the AboutDialog class and override the createButtonsForButtonBar(Composite) method :)
and use your own InstallationDialog subclass.
to avoid displaying the tabs you don't want you have to override the createFolderItems method.
give a look the loadElements method to understand how this part of the dialog works.