0

I am trying to create new pages for a custom module I am developing.

the base page for my module is:

www.mywebsite.com/forum

I wanted to add three more pages:

www.mywebsite.com/forum/category
www.mywebsite.com/forum/category/post
www.mywebsite.com/forum/user

I am having a few issues with doing this.

  1. to reach the /forum/category and /forum/user page, It is making me use the url /forum/index/category and forum/index/user. How can i remove the "index" part from the URL?

  2. When I access the page /forum/index/category/post, it is loading up the template .phtml file for /forum/index/category and not the one I have create for Post. The layout .xml file for this page points to the correct template .phtml file. What could be causing this?

Thanks.

1
  • What is your controller name? – Keyur Shah Jan 17 '18 at 11:48
2

create three folder in Controller according to your url.

www.mywebsite.com/forum/category

Namespace\Moduelname\Controller\Category\Index.php

www.mywebsite.com/forum/category/post

Namespace\Moduelname\Controller\Category\Post.php

www.mywebsite.com/forum/user

Namespace\Moduelname\Controller\User\Index.php
1
  • Cheers Qaisar, Exellent answer. – user61783 Jan 17 '18 at 12:16

Your Answer

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