AbleCommerce Forums
»
AbleCommerce
»
Content Management System
»
9.0.2 Copied theme has hard-coded paths back to Sample theme
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)
|
Copying a theme still leaves all elements in the copy pointing back to the sample theme.
Assume you copy the Sample theme to 'JoeTheme'. Edit the /JoeTheme/Views/Shared/_ThemeStyles.cshtml file after you make the copy.
Everything in the file still points to /Themes/Sample/. The urls should all have been changed to point to /Themes/JoeTheme/
I thought this was fixed in 9.0.2?
|
|
|
|
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)
|
|
|
|
|
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)
|
Hi Joe,
Did you copied the theme from the admin panel UI or had it manually from file explorer? If you use the copy function from the admin panel it will update all the resource paths to new directory path. I have tested again and it's working fine.
Please also make sure that after copying a new theme you didn't miss assigning the new theme as store default theme or assign it to a page you are testing on.
Thanks Shaharyar
|
|
|
|
Rank: Advanced Member
Groups: Admin, Administrators, Developers, Registered, HelpDesk, Authorized User Joined: 7/31/2019(UTC) Posts: 77
Was thanked: 8 time(s) in 8 post(s)
|
Hi Joe, just for information, I will like to add that in 9.0.2 we can use the ~/Themes/[THEME NAME]/Theme.cofig file for scripts and style sheets configurations. This file do not require full paths for style sheets or script files. Thanks, Naveed Edited by user Tuesday, April 7, 2020 3:07:12 AM(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
Hello Joe, Let me expand on Naveed's comment. In 9.0.2 we made some changes to theme handling and now out of the box, every theme should have a Theme.config file. This would allow you to provide a display name, description, and theme includes. You can still override the Script/Styles handling as an advanced mode as it was the case before.
We are using Theme relative includes in Theme.config and it will always point to the correct theme after you duplicate it. If you are using view override to provide theme/style handling then you should adjust your view file to have theme relative includes. You can use the Theme name from view context to build a Theme specific include. Please check Website/Views/Shared/_ThemeStyles.cshtml. Perhaps you are working on an upgraded install where your sample theme has the old script/style include files under the theme. If you haven't made any updates to theme views then simply remove the views folder from the theme. The sample theme in 9.0.2 comes without any views out of the box, you can override them if you need them.
|
|
|
|
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)
|
Yes this install is an upgrade.
I haven't modified anything yet. I just went to the Themes page in admin, told it to copy the Sample theme and then started digging into the copy. So you're saying those files are left over from old way of doing themes?
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
Yes, they are leftover files unless they were customized for some reason.
|
|
|
|
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)
|
They may have been customized, I don't remember.
Regardless, are they still being used if they do exist? Or are they dead files?
I'm really confused by your "If you are using view override to provide theme/style handling" comment.
Am i right here: You're saying the current (9.0.2) Sample theme does not have a 'Views' folder. And the only place to specify includes/bundles is in the theme.config file. Now, if you want to set up some overrides to base theme implementation of views, then you can recreate the Views folder and it's subfolders and all those files....and AC9 will use those files.
Is that correct?
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
Quote:You're saying the current (9.0.2) Sample theme does not have a 'Views' folder. And the only place to specify includes/bundles is in the theme.config file. Now, if you want to set up some overrides to base theme implementation of views, then you can recreate the Views folder and it's subfolders and all those files....and AC9 will use those files. Yes, your understanding is correct. They are not dead they are just not needed anymore just for a theme script/style includes. Edited by user Tuesday, April 7, 2020 7:21:35 AM(UTC)
| Reason: Not specified
|
|
|
|
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)
|
Ok. So if I need to wrap the body of all pages in a class, then I'll have to implement the override views, right?
Something like this: <body class="stretched">
<!-- Document Wrapper ============================================= --> <div id="wrapper" class="clearfix">
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
Yes, that could be a use case. Also for example you want to change HTML of a buy product dialog then you can duplicate it under theme and change.
|
|
|
|
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)
|
Mazhar if we duplicate a partial view into the Themes folder, does it need to maintain the original folder structure or is MVC just going to drill down every folder it finds?
|
|
|
|
Rank: Administration
Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered Joined: 10/5/2018(UTC) Posts: 175
Thanks: 8 times Was thanked: 17 time(s) in 15 post(s)
|
You need to maintain the same directory structure under /Views folder.
|
|
|
|
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)
|
|
|
|
|
AbleCommerce Forums
»
AbleCommerce
»
Content Management System
»
9.0.2 Copied theme has hard-coded paths back to Sample theme
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