Hello,
My site:
www.earthscauldron.com
I have all the banners (banners are a slide show on the home page) set to NOT open in a new window. They are all opening in a new window.
Any suggestions on what may be going on here?
Thanks so much!
Hello,
My site:
www.earthscauldron.com
I have all the banners (banners are a slide show on the home page) set to NOT open in a new window. They are all opening in a new window.
Any suggestions on what may be going on here?
Thanks so much!
in your admin > toold > banner manager screen - do all of your banners have a red "X" in the "New Window" box??
Zen-Venom Get Bitten
you need to look at the code that generates the slideshow. the html <a> link has a target of _blank which most browsers will cause to open in a new window or tab.
i am unfamiliar with this template and more specifically the construction of the slideshow, but i would search for where _target is in the code and more specifically in the construction of that slideshow.
from your home page:
HTML Code:<li class="slide-2 activeslide" style="visibility: visible; opacity: 1;"> <a href="http://earthscauldron.com/index.php?main_page=redirect&action=banner&goto=17&zenid=7bi8jr7oshlssc96i86q2ka7c1" target="_blank"> <img src="http://earthscauldron.com/images/banners/slide4.jpg" style="width: 1840px; height: 956.8px; left: 0px;"> </a> </li>
I found the line of code in includes/functions/banner.php
This:
Line #142 : $banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner->fields['banners_id']) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';
How would I go about this. Do I comment it out or type something else there? Do I delete "target=_blank" altogether? I'm not sure what to do. Nothing else seems to be working that I've tried. Except breaking the slide show a few times
I also found this on line 42:
if ($banner->fields['banners_open_new_windows'] == '1')
Does that '1' have anything to do with it?
My suspicion is that there is nothing wrong with the zc files, but that the slide-show script is the culprit. From what I can decipher, the script defaults all links to be target="blank"
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
I would agree that it is not the php code of ZC, though looking at least at one of the more recent versions there are more possibilities that target="_blank" and not that...
Another thought though kobra asked about the current state, can you confirm that the state can change of the banner, and then also compare the resulting source code differences to help further the troubleshoot.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
the OP confirmed that the banners are turned off in the banner manager. perhaps EC's banners function has changed; perhaps it never worked in V1.5.1. i do not know.
the code the OP listed on line 42 suggests that the template may honor the flag associated with the banners opening in a new window; however if the banner link construction is being done on line 142, my guess is that the 100 lines of code is far too many for them to be related.
EC, i would compare your code to the following code around your line 142:
this is how it looks under v1.5.4 and it would seem to honor the flags mentioned above. if your code does not look like this, you should copy this code to replace your line 142 and see if that works.PHP Code:
if ($banner->fields['banners_open_new_windows'] == '1') {
$banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner->fields['banners_id']) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';
} else {
$banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner->fields['banners_id']) . '">' . zen_image(DIR_WS_IMAGES . $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';
}
line 42 should be left alone.... although i'm not really sure what it is doing up there.
on your single line, you code just change the following, but then your flags would not work (which is what is currently happening anyway):
good luck!PHP Code:
//original line
$banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner->fields['banners_id']) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';
//new line
$banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner->fields['banners_id']) . '" >' . zen_image(DIR_WS_IMAGES . $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';
No, the op confirmed that the admin reflected an off condition... That is different than 1) transitioning from off to on or back, and 2) how the front end and this "non-functioning" feature relate...
As to the code provided above by the OP that is the code from ZC 1.5.1. http://github.com/zencart/zencart/bl...ons/banner.php. It does seem that one "solution" would be to upgrade (at least to take advantage of other options), but not likely to resolve this issue. Further, it seems as if the issue is more either in a javascript file (.js) or a database entry meaning that any developer's toolkit searches should target files other than .php for that content...
Also, by copying just the text of the identified line numbers would/could end up affecting operation to where if the option(s) aren't tracking properly then more issues could result... One issue is/would be is that if only those lines were duplicated then when the image should be popup it wouldn't do so because the target variable would still be empty... Reverse trouble...
Also, there is no indication about the history of this installation in particular the remaining parts of the posting tips...
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks