logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
charles25686713  
#1 Posted : Tuesday, November 8, 2022 3:09:59 PM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Hi, is there a documented process on how to add a new menu option in _AccountSideMenu? I have a custom My Recordings tab from AC Gold that I'm trying to recreate in AC9.

I created a partial view _MyRecordings in Views/Members/ that gets data from a modified MembersController.

I modified _AccountSideMenu to show the menu link.

I added a Shared/Inner/MyRecordings placeholder (modeled after MyOrders).

The menu link shows.

When I click on it, it renders, but like a new page outside of the AC website. As such, it doesn't render properly, but the content is coming correctly from the modified controller with a new Action.

I found it likely needs an entry in ac_CatalogUrls. Not knowing the best way to add an entry, I sort of duplicated the one from MyOrders, changing it to MyRecordings.

After restarting IIS, that caused the page to to render in the AC admin content area, but all I get is:

[[ConLib:ProductRow]]

At this point I figured I'm in over my head and need to ask for help! :)

Thanks

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

Joe Payne2  
#2 Posted : Wednesday, November 9, 2022 2:54:32 PM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
Creating new pages on the shopper side require more effort than a traditional MVC page. In your specific example you mentioned, here's what to do:

You have to understand how the pages are built. In order for Able to handle the 'theme' aspects of the page, you have to let Able do some of the page construction. This means you're going to create a partial view, not a full view.

First add your actionresult to the /Controllers/MembersController.cs. I made it partial and put my new stuff in a /Custom/MembersController.cs. Your actionresult will return a partial view. Now create your partial view in the /Views/Members/ folder. Be sure to look at some of the other widgets in the controller to see how Able decorates them with an attribute so they are detected as a widget.

Next, you use the admin side to define the widget layout and the page itself:

First, find the Website->Store Design menu and go to inner templates. You're going to make a new inner template, define that template layout and then drag-drop your widget onto the inner template. Save the inner template.

Next, define a content page. This is where you're going to set the url i.e. "Members/MyRecordings" and specify the inner template you just created.

At this point, now the url is wired up to a view created by Able that will properly include the configured store theme. Within that view Able will render the partial view aka widget that you created.

It's best to start simple. Don't try to code the whole thing from the start. Make a dumb, simple 'Hello World' widget first. Get that working. Get the feel for how Able wants the pages defined. And then grow it from there.

It's definitely a learning curve. But it makes sense once you get the hang of it. And it's incredibly granular as your needs get more advanced.

Edited by user Wednesday, November 9, 2022 2:55:46 PM(UTC)  | Reason: Not specified

thanks 1 user thanked Joe Payne2 for this useful post.
charles25686713 on 11/9/2022(UTC)
charles25686713  
#3 Posted : Wednesday, November 9, 2022 4:22:11 PM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Hi Joe, thanks for the walk through.

I was really close. I just didn't know how to add the internal mappings through the UI to get it to render properly.

It's working great.

Thanks again!

Originally Posted by: Joe Payne2 Go to Quoted Post
Creating new pages on the shopper side require more effort than a traditional MVC page. In your specific example you mentioned, here's what to do:

You have to understand how the pages are built. In order for Able to handle the 'theme' aspects of the page, you have to let Able do some of the page construction. This means you're going to create a partial view, not a full view.

First add your actionresult to the /Controllers/MembersController.cs. I made it partial and put my new stuff in a /Custom/MembersController.cs. Your actionresult will return a partial view. Now create your partial view in the /Views/Members/ folder. Be sure to look at some of the other widgets in the controller to see how Able decorates them with an attribute so they are detected as a widget.

Next, you use the admin side to define the widget layout and the page itself:

First, find the Website->Store Design menu and go to inner templates. You're going to make a new inner template, define that template layout and then drag-drop your widget onto the inner template. Save the inner template.

Next, define a content page. This is where you're going to set the url i.e. "Members/MyRecordings" and specify the inner template you just created.

At this point, now the url is wired up to a view created by Able that will properly include the configured store theme. Within that view Able will render the partial view aka widget that you created.

It's best to start simple. Don't try to code the whole thing from the start. Make a dumb, simple 'Hello World' widget first. Get that working. Get the feel for how Able wants the pages defined. And then grow it from there.

It's definitely a learning curve. But it makes sense once you get the hang of it. And it's incredibly granular as your needs get more advanced.


Joe Payne2  
#4 Posted : Thursday, November 10, 2022 8:21:02 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
Glad I could help. 18 months ago, I couldn't spell MVC let alone code it :)
charles25686713  
#5 Posted : Thursday, November 10, 2022 8:41:16 AM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
Same! I spent a LOT of time learning Blazor this year, and it helped me a lot when it came time to turn my attention to the AC upgrade and MVC.

I'm hoping the day isn't too far down the road when AC switches out of Framework and into Core...!
Joe Payne2  
#6 Posted : Thursday, November 10, 2022 8:44:24 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
I haven't messed with Blazor yet. You like it better than Razor?
charles25686713  
#7 Posted : Thursday, November 10, 2022 8:58:02 AM(UTC)
charles25686713

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 7/1/2022(UTC)
Posts: 71

Thanks: 5 times
Was thanked: 1 time(s) in 1 post(s)
I like Blazor a LOT. It's like how "webforms" was supposed to be. Much easier to be productive than MVC is!
Users browsing this topic
Guest (5)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.