How to modify com_mailto to fit out needs - joomla

I'm developing a site for my company and I also need to modify the native component "mailto" to fit our needs.
I'm working with a joomla 2.5
I was wondering if future updates occur, what will happen to the lines I've added, for example, in "\components\com_mailto\controller.php"...
I haven't find answers on the net.
Also, for the same reason, I've modified the default layout of an article. Should I rename it? and if yes, how, because I couldn't do it (when I've tried the article did not display).
Thanks for your help

Before starting to edit core Joomla components, should should always have a look at the options you have. I don't believe in editing core file as it simply causes problems for updates when released, therefore in my opinion, you have 2 options:
I always make a note of all my requirements and start looking for a 3rd party extension that caters for my requirements.
If I cannot find a 3rd party extension and don't particularly want to start digging into it's code, I would go with developing a plugin. Plugins are used to manipulate the behavior or something and therefore come in extremely handy for when you would require core editing.
Editing the layout of an extension view is completely fine, but it's strongly recommended you make a Template Override so that if the extension does ever get updated, your changes won't get overridden.
So to answer you initial question, any line you have added to the controller.php file will get overridden when you decide to update the extension.
Hope this helps

While the answer from Lodder is totally valid, as a last resource you can also consider forking the com_mailto as a separate component.
This has some disadvantages:
you need to rename all the files involved (controllers, models, views)
you need to maintain it and keep in in sync with future updates (consider than you are now on 2.5.x and in a year you might want to upgrade to 3.x).

Related

How to customise a Laravel application

I'm total newbie with Laravel, so the question might not be the most intelligent, be gentle, please.
I'd like to use an Open Source application made with Laravel. However, the application does not fully suit my needs, hence some customization is needed.
Naturally, I don't what to change the application files and also want to keep all my files separated.
In other PHP-based applications there are typically methods to customise the app without touching any other code. Also, it is possible to have own code nicely in one place. For instance, Wordpress has a theme concept, child theme concept, plugins and hooks in code (filters and actions). In Magento we have a simple method of overriding a core file by copying it to local code pool, as well as a more sophisticated dependency injection, which allows to override any class anywhere.
I've been trying to understand what is the correct way to customise a Laravel application in such a way, that my own modifications are separated from the base application and e.g. updating the base is possible.
Please guide me, or give pointers on how to do this.
Sounds like Packages might be your best option.
https://laravel.com/docs/master/packages
They let you customize very much in your application without touching other parts of the code, as well as keeping it separated from the other parts of the application.
Here's a getting started guide on packages:
https://medium.com/#lasselehtinen/getting-started-on-laravel-package-development-a62110c58ba1

Joomla 2.5 Add Option Groups to Article

I'm playing with Joomla 2.5.9 (The latest 2.X download). Do you know how you can add additional menu's to the "Article Manager: Edit Article" page? (This is in the Administration)
Their API gives me some hint on several things but I am don't know what this right "Slide Down Option Area" is called in the Administration.
In the right area there are things such as:
Publishing options
Article Options
Configure Edit Screen
Images and Links
etc..
I want to know where to start to add my own, or where they are already built in the system so I can base mine off it -- Is this a plugin, module, or something else? :)
As i say don't change any of the core file in Joomla. If you want to add any functionality into the article manager you can make your own plugin to add functionality in it. For doing this see this link :
Creating a content plugin
I hope this is what you looking for.Good luck.
There are some extensions that allow you to do that.
I recommend (although somewhat buggy and a code mess) this one:
FieldsAttach
It does exactly what you want.
Or, you could make your own as Toretto suggests, there are some tutorials on creating a plugin for extra items in the article form, but the already-made-extension route seems to make more sence.
I've been using FieldsAttach for this sort of thing, for a few years, the code is often a little messy, that is true, but the the concepts are clean and eloquent. Brian Teeman explains it well from an integrator point of view in his talk at https://www.youtube.com/watch?v=f2WLKWbRj5U but in some ways it is even more compelling from a developer's perspective.
However, after watching Marco Ding's Joomla Day UK 2016 talk on https://www.youtube.com/watch?v=KDh1IPuZAVA I think DPFields may be a better choice. The architecture is perhaps more rugged and neater, but also because it may well end up being a core extension in Joomla in the near future. More info on DPFields is at http://extensions.joomla.org/extension/dpfields , https://joomla.digital-peak.com/products/dpfields and https://joomla.digital-peak.com/documentation/162-dpfields .

Joomla Discussion - When to create a plugin, when to create a component?

I have been learning to develop my own plugins and components for joomla! 2.5.
After a couple of months of developing features for my site, I am starting to realise that some of the components I have created could have probably been just as effective if I'd developed them as a plugin for com_content or com_user.
My question is what's the best way to decided if a full component is needed and when is it ok to use one or multiple plugins to give the same functionality.
My feeling at the moment is that plugins are a much nicer way to go due to them being self contained. Maybe I've answered my own question, and components are needed when interaction between elements is more complicated, where as plugins can be used for very modular functions.
Anyone else have a view?
Components and Plugins are completely different types of extensions.
Components are applications/systems that will appear in the content area such as VirtueMart and where the articles are shown. Consider them as software for you computer.
Plugins are there to manipulate Joomla and/or there extensions it's using. They contains functions that are associated with trigger events. So in a nutshell, they are there to extend the functionality of an existing extension.
So so answer your question, have a think about what you are creating and if will be an aplication or something to extend functionality.
Hope this helps

Joomla: alternative content for an article

I've just started work on an existing Joomla! site, and have a requirement to add an alternative language version of an article. Note that this isn't a full-internationalization effort - we don't need every part of the interface translated - just the need to have another 'version' of an article. Ideally, though, this would include more than just the core content - for example, title. I don't really want to create a second article because, in essence, this really is just a single article, and I don't want things like comments to be split between two separate articles.
Does anyone know if this can be done using joomla core?
If not, can anyone recommend an existing component that will do this?
A good component for manage translations in Joomla 1.5 is Joom!fish. It allows you to do a whole internationalization that, as you said, isn't exactly what you want to do. However I like to think in the long run so, if there's more change, I have not to restructure again and again just because of I haven't thought it before. Hence, if I were you, I would like to use Joom!fish anyway.
Well, as a short fix - Google Translator works and can be installed into your template you're using.
Then you can set it to be hidden unless the users browser is set to use a different language as default - then a small pop-up box drops down and it asks to translate it using google translate.
If that's not the option you're looking for - joom!fish is a good component others rave about but I don't have much experience with personally. Outside of that I'm not really sure.
Hanny had a good idea that would be really easy to implement in an article with the right extension. You can use this extension -
http://www.nonumber.nl/extensions/tabber
This would allow you to easily create tabs with the translations available anywhere you have them. The page above uses the extension to display the tabs, it would be trivial to implement.

Magento Training Examples [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
If you have trained a new Magento developer what were some if any dummy tasks you have given them. Besides reading all of the articles out there and doing the examples, I am looking for some ideas to give developers to work on after reading as much about Magento as they could without actually working on a task.
If anyone has any good ideas please let me know, You can even post some good code snippets of possible answers and what not. This might be a good thread to keep if we get a lot of good answers, for us tech leads out here responsible for training.
They could be frontend design template or building modules, it doesn't really matter. If someone posts a really good example, I will mark that one as the answer.
Not sure this is appropriate for Stackoverflow, but not sure where else to put it where it would be answered with quality responses.
The tasks I've given before really depend on what the developer needs to do as part of their normal job. I tend to give tasks that force the "rabbit hole" situations early on in the process, and make sure that the developer has enough support to come and ask when they get stuck.
For frontend developers, the best thing to do is develop an actual theme, or whatever tasks need to be accomplished in some current project. As examples, ask them to:
Create a new theme directory w/ skin directories, etc
Change a template (the product/list.phtml and product/view.phtml are both common here) to accomodate some desired new functionality.
Add a JS lib to the product page for zoom or some other functionality, to be loaded cleanly using Magento's facilities.
Create a new page, including complete controllers and layouts as appropriate, with functionality to be fleshed out by a backend developer.
Change the CSS to the One Page checkout to fit the new site theme, without breaking CSS for the rest of the site.
For backend developers, again the best thing is the real thing. Developing backend modules takes some significant familiarity, but hitting the highlights isn't too bad. Examples:
Start a new Magento module.
Override a core Magento class with one from the local module
Create some administrator functionality to deal with the new module.
Add an ACL so that this functionality can be enabled / disabled for particular admin users.
Integrate with frontend code (see the frontend developer above) to provide the functionality to the end user.
Append to the system configuration to use the new functionality as part of the normal system.
These are just general ideas, but they will quickly force a developer to gain some understanding of the way Magento is laid out and how it operates. Of course, it can take weeks or months of supportive mentoring to get the developer to the point where they are a self-sufficient developer on Magento, but that's largely a matter of filling out the details after items like this.
Hope that helps!
Thanks,
Joe
This is what we send applicants to see if they even know what magento does/how it works ... not sure if this is what you meant ...
Please perform the following:
Override a controller action:
Override the Mage_Customer_AccountController keeping all the original functionality except that the logoutAction redirects to the home page immediately not the logoutSuccess page.
Override a model function:
Override the Mage_Customer_Model_Customer model keeping all the original functionality except that the getName() function always returns "Magento Rocks".
Modify a Block:
Change one of the blocks used on the customer/account/index page to display a message of your choice.
Add an Observer:
Add an observer so that after the order has been created on the frontend the last name gets changed to "Is Awesome"
Its not really practical ... at all ... but it lets us see if people can code in Magento in a decent way instead of just modifying core files and such. As with almost anything in Magento there are different ways to accomplish the various tasks, perhaps have them figure out the different ways or have them determine which way would be most appropriate.
Note: Just to emphasize so that no one points it out, these "tasks" were not designed for practical use and in fact you probably will NEVER do any of these, they were intended to see if someone could actually do things (override a model method etc) the Magento way.

Resources