0

I am trying to write simple component for Joomla 3 to show catalogue and products.

I did made my model catalogue and it works ok - it shows list of all products with pagination, but I also want to make clickable link for each product to open detailed product info (this page should be accessible by alias).

What is a correct way to organize this scheme in MVC?

Should I make a new model (??) but how to make aliases and give item's id to this page?

I did read a lot of tutorials but I never seen any tutorial with library or catalogue example.

Thanks in advance, guys

1

I´ll describe the way I did it.

I created a system plugin that responds to the onAfterInitialise event to create a new router.

$router = $app->getRouter();

So I can use my own rules:

$router->attachBuildRule(array($myRouterRules, 'build'));
$router->attachParseRule(array($myRouterRules, 'parse'));

The alias of my product is:

alias-p2

For instance for a product named: This is a great product with ID = 5 the alias would be:

this-is-a-great-product-p5 

The my parse rule will identify if the URL ends in -pX and if so it will send the url query for my detail product screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.