| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How do I create a page in the admin panel?? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How do I create a page in the admin panel??
Ok, i've been on this for two days. all the docs/walkthroughs are way too specific. I just need to know how to create a page in the admin section.
here's what I've done so far: created a new controller that extends \XLite\Controller\Admin\AAdmin. It has getTitle and getAllowedTargets and both of those seem to be working as expected. I have created a LeftMenu item to point to my new controllers target. this also seems to work. NOW... how do I assign this controller an actual template and action? The ONLY thing I need this to do is export some data (which I can figure out), but first I need to get some type of information besides the title to display on the page. I don't need an itemlist or any other complex model. right now i'm just trying to add some static content to the page. please help :'( it's been two days!
__________________
SEEK HAPPINESS. EVERYTHING ELSE IS DETAILS. |
|||||||
#2
|
|||||||||
|
|||||||||
Re: How do I create a page in the admin panel??
I feel your pain! Maybe this will help:
Create a file: XLite/Module/YourDevID/YourModule/Controller/Admin/MyPage.php with these contents: Code:
Create another file: XLite/Module/YourDevID/YourModule/View/MyPage.php with these contents: Code:
The above of course assumes you already have a Main.php for your module. Here is what has confused me in the past, and Tony helped me understand: Your Controller, must be named the same as your target. If your target is: some_funky_target Then your controller must be: SomeFunkyTarget.php
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#3
|
|||||||||
|
|||||||||
Re: How do I create a page in the admin panel??
Okay now that we have the proper code established, we need a template.
Create your template: skins/admin/en/modules/YourDevID/YourModule/my_page/body.tpl with these contents: Code:
X-Cart automatically looks in the result of getDir() for a template named body.tpl if getDefaultTemplate() is not specified. And it will look in the skin admin directory if this is an admin controller.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#4
|
|||||||
|
|||||||
Re: How do I create a page in the admin panel??
Quote:
OMG thank you! that's what I was missing (and what the docs are missing). I had just about everything correct, except the name of the target and couldn't figure out how to connect them.
__________________
SEEK HAPPINESS. EVERYTHING ELSE IS DETAILS. |
|||||||
|
#5
|
|||||||||
|
|||||||||
Re: How do I create a page in the admin panel??
You are quite welcome! Glad it worked. It did sound like you were 90% of the way there. I just posted the other info to provide a complete picture for anyone else that needed the solution.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|