Jump to content
Latest News: (loading..)
kymation

[Addon} Theme Switcher

Recommended Posts

9 minutes ago, mmotala10 said:

Hey @mdtaylorlrim 

Hope your online store has been moving well. I saw the issue you were having and I think I'm experiencing the same thing you were, could you walk me through what you did in order to fix it? I'd really appreciate it :) 

Actually, I don't remember as it was far too long ago. It does say right in the post that I changed the code so that I would see the detail of the error. i.e. See the full path to the file that could not be found. That is where I saw that the constant DIR_WS_LANGUAGES had not been assigned a value. That should happen in the compatibility add-on but was not, for some reason. So I traced the directory structure for where the file actually was found and forced the value into the variable. It all worked after that, and does to this day.

If you don't understand what I said then you should probably stick with the advice from others that are far more experienced in this than am I.

Sorry.

Mark


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Hi,

I just installed it and the instructions mention only the one line change in the /includes/template_top.php file, however, I noticed that there was another change made. The viewport meta tag had the following content attribute removed in the add-on file: shrink-to-fit=no

If this is a needed change, the instruction documentation should be updated.

Also, possibly in a future release, it would be good to have a preview of each theme in admin because as of right now, you have to change it, save it, and then go to the home page and refresh it. Even a selection of screenshot thumbs would be good on that admin page.

I was really looking to change the layout some like that of the header, footer, menu and main body. I'm not sure if there is an addon for this or any documentation on how to customize these areas. Any help would be greatly appreciated. Thanks.

Share this post


Link to post
Share on other sites

Actually a couple of other changes in that /includes/template_top.php file with the jquery version and the font-awesome style-sheet version.

 

Share this post


Link to post
Share on other sites

Thanks Frank, ..any documentation on customizing the header and footer? I'm still trying to get familiarized with the file structure and code.

Share this post


Link to post
Share on other sites

@Demitry

No guide as far as I'm aware. It's just a matter of right clicking an element, looking at the css and then overriding it in the catalog/user.css file. For instance, if you add

.panel {
    border-radius: 0px;
}

.panel-heading {
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

to your user.css file all the panels (which includes right and left boxes) will have square rather than rounded corners.

Add this to user.css and all the panel-default boxes turn orangey with a brown border.

.panel-default {
    border-color: #5D4C46;
    border-top-color: rgb(93,76,70);
    border-right-color: rgb(93,76,70);
    border-bottom-color: rgb(93,76,70);
    border-left-color: rgb(93,76,70);
}

.panel-default>.panel-heading {
    color: #000;
    background-color: #F1A94E;
    border-color: #5D4C46;
}

You can also adjust heights etc, but you need to learn about css first.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

I can work with css, but I was looking more to re-positioning the divs and recreating the layout structure for the header, footer, menu, and main body. The default layout is nice, but plain and the Theme Switcher only changes the layout colors.

Share this post


Link to post
Share on other sites

@Demitry  This Addon was written against an older version of Edge, so there may be differences between the included copy of /includes/template_top.php and the current version of that file. You should make only the change referred to in the instructions to avoid unexpected effects.

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

ok, good point, ..thanks Jim

So, where do I change the layout for,.. lets say the header? Is it in the /includes/modules/content/header/templates/... and related CSS classes? Where is all this compiled?, on the individual page? or is there a grid of some sort that is sectioned into zones? Still struggling with the new structure.

Share this post


Link to post
Share on other sites

@kymation @frankl

I found this online and it's of great value in regards to how Boostrap is structured via CSS, but I am still a bit at a loss as how to move these elements around in 2.3.4-BS-Edge.

https://getbootstrap.com/docs/3.3/css/

For example the header has 5 templates of elements, but I cannot figure out where these are constructed to form the header. If I know this piece, then I can use CSS based on the grid to position them where I need them.

It seems like there are so many files to construct each element and section of the page that it gets a bit confusing. Once I figure this out, it should be fine, and I will make appropriate CSS adjustments where needed for each of the 4 browser resizing points. I just need to know how this is all constructed. If there is any documentation on this, that would certainly help. Thanks.

 

Share this post


Link to post
Share on other sites

Each part of the header is a sub-module that is called from the header module (cm_navbar.php). You can change the order of each of the parts in the sub-module settings. If you need more than that, examine the HTML that is generated by the modules using the Inspect tool in Firefox, Chromium, etc. That should give you the CSS being used and the class/id to target new CSS.

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

@kymation

Jim,

That file cm_navbar.php  is not the header module. It is one of the sub-modules that the header is composed of. It is that top black bar that contains the osCommerce link on the left and the shopping cart link on the right (by default).

So, /includes/template_top.php requires the /includes/header.php file, which calls $oscTemplate->getContent('header');

I get that all the header templates for the header are located via /includes/modules/content/header/templates/... However, where are all these header sub-modules / elements / templates,.. structured into the actual header? There has to be a file where these elements are all compiled to form the header.

 

Edited by Demitry

Share this post


Link to post
Share on other sites

In the latest version of Edge that I have, the master navbar module is includes/modules/content/navigation/cm_navbar.php and its template includes/modules/content/navigation/templates/navbar.php, and the sub-modules are in includes/modules/navbar_modules/ and the templates in includes/modules/navbar_modules/templates/. If your version is not arranged this way then I can't help.

We've gone off topic here anyway, so please continue this discussion in a new thread in the general forum.

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

ok Jim,

I do have the latest version and my version is arranged the same way, but the ../navbar_modules/templates/ all have to do with that black bar at the top of the page and not the rest of the header.

I understand that this thread is support for the Theme Switcher addon, and I am trying to change the theme layout,.. hence, why I posted here. However, I will try the 2.3.4-BS-Edge forum. Thank you for your help.

Demitry

Edited by Demitry

Share this post


Link to post
Share on other sites

I have added a new version that fixes some issues with the latest version of Edge in the Bootstrap version. There is no need to update if you already have this installed, but it will make new installs easier.

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
Posted (edited)

I think you should correct the Bootstrap guide:

2.2.1 Quick Start

To install this module:
1. Upload all of the files in the catalog directory to your store's directory.
2. Go to your store Admin >> Modules >> Header Tags and click the install button.
3. Click on the Theme Switcher, then click Install Module.

#1 is a bit misleading, because template_top.php is outdated in the package. It's dated 2015-07-15.

Edited by vmn

Share this post


Link to post
Share on other sites

@vmn  The Edge release has been updated thousands of times over the last 2+ years. It's impossible to keep all of my Bootstrap Addons up to date with all of these changes. I'll update everything when Edge is finalized.

Until that happens, I suggest you install the Compatibility Addon, as most of the available Addons will need it.

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Reporting bugs does help. Sorry if I appeared to dismiss your report; that was not my intention. I was just saying that I'm not likely to fix this until Edge settles down a bit more. Hopefully that will be soon.

So thanks for the bug report and thanks again for the specific code.

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

OK.

There is another minor bug, that does not prevent using Theme Switcher.

"template_top.php has not been modified!" is always returned because the line

<link href="ext/bootstrap/css/bootstrap.min.css" rel="stylesheet">

searched in ht_theme_switcher.php is always found.

Share this post


Link to post
Share on other sites

I had to disable this addon. I was wondering why my user.css changes did nothing. This is why:

<!-- font awesome -->
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>

<link href="custom.css" rel="stylesheet">
<link href="user.css" rel="stylesheet">

<!--[if lt IE 9]>
   <script src="ext/js/html5shiv.js"></script>
   <script src="ext/js/respond.min.js"></script>
   <script src="ext/js/excanvas.min.js"></script>
<![endif]-->
 
<script src="ext/jquery/jquery-3.1.1.min.js"></script>

<link href="ext/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

If the addon is enabled the css files will be in wrong order. The sort order is 1, as suggested.

Maybe custom.css and user.css should be moved after:

<?php echo $oscTemplate->getBlocks('header_tags'); ?>

in tempate_top.php. I did not try.

Share this post


Link to post
Share on other sites
Posted (edited)

That's right. The order of the CSS files is wrong if Theme Switcher is used. To fix the error, move this line:

<?php echo $oscTemplate->getBlocks('header_tags'); ?> 

To just before this code:

<link href="custom.css" rel="stylesheet">
<link href="user.css" rel="stylesheet">

Your bug report is also correct. I need to figure out a way to make that test work correctly with the latest code. Thanks for letting me know about these problems.

Regards

Jim

Edited by kymation
Original answer was wrong

See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello everyone! New here, so I hope this is the right place to post this, and it isn't something entirely obvious that has been handled here several times by now.

So, I installed the latest boostrap version of osCommerce and now the theme switcher addon. I did everything according to instructions and everything seems ok, but every time I click on "save" when changing the theme on my admin panel, it tells me "template_top.php has not been modified!". First it says it has been modified (when I go to modules -> header tags and click on the Theme Switcher), and when clicking save, it gives me that error. What's wrong?

Also, when entering my store, the index page shows this:

Warning: require(DIR_WS_INCLUDESheader.php): failed to open stream: No such file or directory in /storage/ssd5/880/1562880/public_html/shop/includes/template_top.php on line 60

Fatal error: require(): Failed opening required 'DIR_WS_INCLUDESheader.php' (include_path='.:/usr/share/pear:/usr/share/php') in /storage/ssd5/880/1562880/public_html/shop/includes/template_top.php on line 60

I have not done any other changes to such files except for that - the exact change I was instructed to make. What should I do?

Share this post


Link to post
Share on other sites

Older Addons such as this one need the Compatibility Addon to function. As to the warning about template_top.php not being modified, the test for that is pretty simple and not always reliable. I will fix both of these issues some day, but for now just ignore the "not modified" warning.

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×