Grow your CSS skills. Land your dream job.

editing joomla components

  • # April 20, 2012 at 10:47 pm

    how easy it is to edit and customize joomla components. i want to add extra functionality to a component called Course Manager. Is it gnna be easy to creak into the source files and add extra functionality ? and how much knowledge am i gnna need ?

    # April 21, 2012 at 2:48 pm

    Very broad question, you should be much more specific about what functionality you want to add and your knowledge level(s).

    I will try and answer it though…

    From the little I know about that component the source code has an MVC structure that you can override and extend in your template – so any updates to the component will not mean loosing or having to re-write your changes/additions. It is a Joomla! component so it will most likely be PHP and MySQL based, you can read the source and look at the database schema to see what each part is doing and where the data comes from. Once you have done that you will have a good idea of how hard adding any functionality will be.

    If you didn’t understand what you have just read then the answer to “how much knowledge” is “more than you have at the moment.”

    If you are still reading then the source files are easy to read, but the complicated bit is the detail about the extra functionality – that could be very complex or very easy depending on what you want it to do. For example, combining the output of 2 existing parts of the component into 1 place is easy – but if you wanted to write a completely new module to show existing data in a new way, or add more data to the database and integrate it with the component then that will be tricky.

    It is a commercial Joomla! add-on (you have to pay for it) so will have forums – ask there, but be specific.

    Your general “how hard is it to customize?” question is far to broad.

    Ask in the component forums “I want to add blahblah functionality to the Course Manager, is this possible and can you advise me on the best way to achieve this?”

    Of course, if you are wanting functionality that exists already in a linked add-on that they sell you will be told to buy that add-on.

    If you do not get any answers, then I would advise against buying it – if they won’t answer questions in order to get a sale, it is likely they won’t answer once they have your money.

    Have you looked at other options on JED?

    Does it have to be Joomla! , have you thought of trying moodle instead?

    Good luck,

    Chris.

    # April 21, 2012 at 11:36 pm

    thanks a lot !

    that is a lot of explaining. I am a graduating student and i’ve not much interacted with the server side. i am still learning php, i am involved in a college project which has a contract with a client. the client wants to create a dental classroom and ce course management website. the client asked us to create the whole thing in joomla.

    coursemanager was their suggestion (recommendation), but at begining they did not mention me anything about working with MVC and joomla codes. i only have experience in basic php and that is too the levels at which we are taught and all the assignments i do.

    i’ve been looking at joomla MVC tutorials from lynda.com but i am still not able to read the codes from course manager source files, they seems far too complicate for me.

    i’ve managed some functionality that the client wants, but that is all fixed with all sorts of other extension.

    here is a quick look.

    now if you see the listing of the classes/courses, they have a view class button, that is a static button created at the backend, that links to joomla articles, now what i want to do is add, those buttons to the coursemanager component, so that there is a function. so that when ever i create a new course the button appears and it is automatically linked to its respective article in the article manager.

    also, for the courses that are not free has to have a buy now button instead of view course/class.

    I’ve tried posting in the component’s forum and they say, that they are sorry and there is no such functionality available. but, my project co-ordianter wants me to crack in the codes and make all changes.

    i am so stuck in the codes now…. still finsing ways to make them work as they want.

    thanks for your reply :)

    cheers

    amit

    # April 22, 2012 at 9:01 am

    OK, first point is that you do not seem to have the skill level required to make the new functionality – make your project co-ordinator understand that it will take you more time to do make the changes because you have to learn new things – tell them how long you think it will take and why, keep them informed of your progress, both good and bad.

    The changes themselves do not look that hard to implement, the necessary code and data is already available – it just needs your time and patience to run through the code while looking at the page(s) in action and seeing where each bit of HTML is created.

    The modifications themselves…

    1. Automatically adding a button to link to the course details…

    In order to link to an article, that article must exist first (or you have to know the alias or id number that will be assigned to the article once it is written) – or you will deliver a 404 page when someone clicks the button.

    Assuming the article is written, then all you need to do when creating a new course is to enter the hyperlink to the article in the hyperlink field in the course editor backend. This field already exists in the course manager software – check out the demo to see it.

    To modify the component you need to find the part of the code that writes the table for the course (view=courses in the demo) and change it to use the hyperlink field instead of the course id for the button link. This should be pretty easy to do.

    2. IF payment is required…

    You already have this information when the table is written.

    A simple IF statement added to the code – at the same point where you changed the default button link to the article link – to say if the cost > 0 then create a link to the payment page.

    Again the code for this link and the button to use is already present in the View code (view=paypal as you can see in the demo frontend).

    This is pretty simple to do once you find the right bit of the code to use/copy/modify.

    Remember to make the changes in your template directory structure, not the component itself – so you override the default code instead of changing it.

    Basically copy the view file from the component to your template:

    from: components/com_courseman/view/default.php
    to: your-template-name/html/com_courseman/default.php

    where default.php is the file that contains the functionality you want to change.

    Now any changes you make to the code in the “your-template-name/html/com_courseman/default.php” file will be used instead of the code in the “components/com_courseman/view/default.php” file.

    The changes you want to make do not sound hard, you just need to spend some time with the code in one tab, with the page open in another (with the inspect element pane open). Look at the page, look at the elements, the class names, etc and find where they are in the code. Make a change and see what happens.

    Good luck,

    Chris.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".