Select your language

Example SEF URL: http://localhost/joomla_demo/en/joomla-web-development

Steps to Create SEF URLs:

  1. Create a Menu Item:

    • Go to the Joomla admin panel and create a menu item for each course.

    • You can create this inside the Tarbiat LMS menu or the main menu.

    • Set "Display in Menu" to "No" to keep it hidden.

  2. Fetch the Itemid in default.php:

    • In your component’s default.php file, loop through items like this: foreach ($this->items as $i => $item) :

    • Get the course menu using a helper function: $coursemenu = coursemenuFromJoomlaMenu($item->id);

    • Match the course database ID with the menu parameter course and get the Itemid.

  3. Generate the SEF URL:

    • Pass the Itemid into the URL, which will generate a clean SEF URL like /joomla-course.

And that’s it! You’ve created SEF URLs for your custom component without the need for router.php. Simple and effective!

Watch Here

 

 Hope this helped.


Still need help! no problem, feel free to contact us Today


 Abdul Waheed : (Hire Joomla & PHP Pakistani Freelancer)