Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
I am not certain if this is even a bug This is regarding the following file "_PaymentSummary.cshtml" which is located in the Areas >Admin > View > Orders. At the Admin Views directory, we have a Custom folder that follows the same directory structure to override files, without having to modify the original ones. My understanding always has been that if the file exists in both Areas >Admin > View > Orders and Areas >Admin > View > Custom >Orders, the last one would take priority. However, we have just found that this is not the case unless you go to the original directory structure, in this case Areas >Admin > View > Orders, and either delete the file there or rename it to something else. I was not aware that you needed to take this additional step. Am I correct in this assumption? Thanks Edited by user Friday, October 29, 2021 1:14:25 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
To override the view files in admin, you need to create a folder on this path Admin->Themes->{CurrentTheme}->Views. Also, add _ViewStart.csthml and web.config files in Views folder. You can copy these files from the Admin -> Views folder.
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
Thanks, but your reply is confusing and I believe you have misread my question. Right now, all files that do not exist under the following directory structure Admin > View > Orders, but do exist under Admin > View > Custom >Orders, are being loaded properly. Question is: What happens if the same file exists in both places at the same time? This is the way it was set up by a previous developer, and I'm just trying to understand, Maybe if you can give me a more detailed answer with examples it would help. >> Also, add _ViewStart.csthml and web.config files in Views folder. You can copy these files from the Admin -> Views folder.<< Those two files are automatically there by default upon the installation of a standard installation. Edited by user Friday, October 29, 2021 7:09:39 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Quote:Question is: What happens if the same file exists in both places at the same time? We never tried using the view files this way. Admin > View > Orders is the default directory structure and my understanding is that the MVC will first look into this directory and if not found it will look into the remaining directories.
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
Please note, the purpose of this conversation is for understanding. I was talking to a new developer, and we were discussing this, and he seems to be confused. Right now, under Areas > Admin > Views, there exists a directory called "Custom", and under that directory there are 3 other directories: - Notes - Orders - Product This is the behavior that I'm observing, if a file exists under Areas > Admin > Views > Custom > Notes, but does not exist under Areas > Admin > Views > Notes, the file is loaded under the Custom directory. If the file exists in both places, it bypasses the Custom Directory completely. In order for the file to properly load under the Custom directory, it can only exist here and no place else. This is working perfectly, but my new developer got confused, that's why I'm seeking clarification. But now you're telling me that the directory structure should be Areas > Admin > Themes > [????????] > Views > Notes.So, you can understand my confusion here, what I have now is working, but I guess the question is, is it something that was set up by the previous developer through some custom configuration or is this behavior by default? Slightly confused, -Ray Edited by user Friday, October 29, 2021 8:18:18 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Quote:But now you're telling me that the directory structure should be Areas > Admin > Themes > [????????] > Views > Notes. This is an ablecommerce feature. We have added this option for the users who want to change the existing view files while keeping the originally released file unchanged. Ablecommerce will give priority to the view files that reside under the theme folder provided that the hierarchy is the same. Quote: is it something that was set up by the previous developer through some custom configuration or is this behavior by default? I think yes, AFAIK there is no default behavior in MVC framework that understands the custom folder in the views folder. I hope I am able to clear the confusion. Thanks
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
You have cleared the confusion to some degree, what I'm going to do is an experiment later this week using the sample directory structure that comes with a new install.
I will report my findings here. From what I'm reading is, if the file exists in the location that you recommend, it can also exist in the original location without having to remove it or rename it, this is what I'm understanding from your post.
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Quote: From what I'm reading is, if the file exists in the location that you recommend, it can also exist in the original location without having to remove it or rename it, this is what I'm understanding from your post. Yes, you are right
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
Give me a couple of days to verify this under a sample installation, and I will report my findings. I hope you can see where this could be a bit confusing. Many thanks for your reply.
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 2/17/2019(UTC) Posts: 909
Thanks: 3 times Was thanked: 15 time(s) in 15 post(s)
|
Hello shaharyar,
VERSION: 9.0.3.6432
As you can tell by the version above, this is a fresh installation of the very first release of version 9. I could not get the above default behavior to work with the sample application provided. It doesn't matter.
My concern was that my old developer did something so if it didn't find the file in one place, it would look to another specific area.
This is okay, it just confused my current developer, and I dislike reinventing the wheel. Right now, the site that launched about a week ago is solid as a rock, no problems, except for Payflow Pro which just sucks.
That being said, we are about to upgrade from 9.0.4 to 9.0.5 to stay current.
So, I am debating whether to take what my old developer did, and just copy all the files back to their original places to avoid any confusion in the future.
Again, my system is solid as a rock and for that simple reason, I don't like to reinvent the wheel.
Just sharing my feedback.
|
|
|
|
Rank: Advanced Member
Groups: Admin, Developers, Registered, HelpDesk, Authorized User Joined: 10/5/2018(UTC) Posts: 704
Thanks: 5 times Was thanked: 113 time(s) in 112 post(s)
|
Thanks for your feedback.
Best of luck with your upgrade process to 9.0.5.
|
|
|
|
Rank: Advanced Member
Groups: Authorized User, Developers Joined: 5/30/2020(UTC) Posts: 125
Thanks: 14 times Was thanked: 3 time(s) in 3 post(s)
|
Sorry to revive an old thread... Quote:To override the view files in admin, you need to create a folder on this path Admin->Themes->{CurrentTheme}->Views. - Is {CurrentTheme} the current storefront theme, or am I missing a place to specify the Admin theme?
- Is the path correct, or should it be Areas->Admin->Themes->{CurrentTheme}->Views? I tried both. Areas didn't seem to reflect my changes. Admin caused the dashboard to throw an error (probably because the route conflicted with a physical directory)
- Are there file requirements for the themes in Admin? I did a pretty barebones setup and only added the web.config, _ViewStart.cshtml, and /Base/_Layout.cshtml. It isn't picking up my changes to the base layout (added Open Sans google web font) even though I set _ViewStart.cshtml to use the custom layout.
|
|
|
|
Rank: Advanced Member
Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System Joined: 10/11/2018(UTC) Posts: 110
Thanks: 19 times Was thanked: 18 time(s) in 18 post(s)
|
Quote:Is {CurrentTheme} the current storefront theme, or am I missing a place to specify the Admin theme? Yes, to override the admin views, you need to create a Theme folder under Areas/Admin/{CurrentTheme} where the CurrentTheme will be your storefront theme. You have to create the folder with the exact Theme name. Quote: Is the path correct, or should it be Areas->Admin->Themes->{CurrentTheme}->Views? I tried both. Areas didn't seem to reflect my changes.
Yes, that is correct. Have you restarted the App pool after these changes? Quote: Admin caused the dashboard to throw an error (probably because the route conflicted with a physical directory)
What the error are you getting? Quote:Are there file requirements for the themes in Admin? I did a pretty barebones setup and only added the web.config, _ViewStart.cshtml, and /Base/_Layout.cshtml. It isn't picking up my changes to the base layout (added Open Sans google web font) even though I set _ViewStart.cshtml to use the custom layout. Yes, only the _ViewStart.cshtml and web.config from the Areas/Admin/Views folder need to be copied to the Areas/Admin/Themes/{CurrentTheme}/Views folder.
|
|
|
|
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.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close