vt Posted June 29, 2011 Share Posted June 29, 2011 I just install 1.4.3 and found that the Bookmark of Permanent Link not stable,sometime its show sometime did not show. :kiss: Link to comment Share on other sites More sharing options...
vt Posted June 30, 2011 Author Share Posted June 30, 2011 Sorry,actually the bookmark never show. Link to comment Share on other sites More sharing options...
Prescol Posted August 14, 2011 Share Posted August 14, 2011 (edited) Are you using Google Chrome? Chrome doesn´t allow javascript bookmarks. Prestashop uses a javascript function to write the link to add a bookmark that works different depending the "User-agent" of the navigator. When google chrome is detected the js function does not write anything. function writeBookmarkLinkObject(url, title, insert) { if (window.navigator.userAgent.indexOf('Chrome') != -1) return (''); else if (window.sidebar || window.external) return ('<a href="javascript:addBookmark(\'' + escape(url) + '\', \'' + escape(title) + '\')">' + insert + '</a>'); else if (window.opera && window.print) return ('<a rel="sidebar" href="' + escape(url) + '" title="' + escape(title) + '">' + insert + '</a>'); return (''); If you prefer can add a link only for chrome to show the alternative method to javascript bookmarks. For ex. "CTRL+D" instructions. Edited August 14, 2011 by prescol (see edit history) Link to comment Share on other sites More sharing options...
Prescol Posted August 14, 2011 Share Posted August 14, 2011 This modify is guaranteed for version 1.4.3. Older & Newer versions please test. You can modify tools.js and add the following code to get a cute "howto" advise. {Prestashopdir}/js/Tools.js Default code: function writeBookmarkLinkObject(url, title, insert) { if (window.navigator.userAgent.indexOf('Chrome') != -1) return (''); else if (window.sidebar || window.external) return ('<a href="javascript:addBookmark(\'' + escape(url) + '\', \'' + escape(title) + '\')">' + insert + '</a>'); else if (window.opera && window.print) return ('<a rel="sidebar" href="' + escape(url) + '" title="' + escape(title) + '">' + insert + '</a>'); return (''); } Replace return (''); with this: return ('<a href="#" class="bookmark_xenon">'+ insert +'<span>Press "Ctrl + D" to add to favorites</span></a>'); New code: function writeBookmarkLinkObject(url, title, insert) { if (window.navigator.userAgent.indexOf('Chrome') != -1) return ('<a href="#" class="bookmark_xenon">'+ insert +'<span>Press "Ctrl + D" to add to favorites</span></a>'); else if (window.sidebar || window.external) return ('<a href="javascript:addBookmark(\'' + escape(url) + '\', \'' + escape(title) + '\')">' + insert + '</a>'); else if (window.opera && window.print) return ('<a rel="sidebar" href="' + escape(url) + '" title="' + escape(title) + '">' + insert + '</a>'); return (''); } Now we should add a few lines to blockpermanentlinks.css Add this at the end of the file: .bookmark_xenon span { width:80px; padding:5px; background:#FFC; color:#666; box-shadow:1px 1px 2px #ccc; position:absolute; /* Modify this depending your template design*/ top:15px; z-index:999; display:none } .bookmark_xenon:hover span { display:block} View the attached file to see the result. 1 Link to comment Share on other sites More sharing options...
smiles1976 Posted December 30, 2011 Share Posted December 30, 2011 Hi, actually my code under "Write bookmark link object" is different from what you attached. Mine reads if (window.sidebar || window.external) return ('<a href="javascript:addBookmark(\'' + escape(url) + '\', \'' + escape(title) + '\')">' + insert + '</a>'); else if (window.opera && window.print) return ('<a rel="sidebar" href="' + escape(url) + '" title="' + escape(title) + '">' + insert + '</a>'); return (''); Where would I insert the code that you were telling me about? Thanks Link to comment Share on other sites More sharing options...
Prescol Posted January 13, 2012 Share Posted January 13, 2012 Hi, actually my code under "Write bookmark link object" is different from what you attached. Mine reads if (window.sidebar || window.external) return ('<a href="javascript:addBookmark(\'' + escape(url) + '\', \'' + escape(title) + '\')">' + insert + '</a>'); else if (window.opera && window.print) return ('<a rel="sidebar" href="' + escape(url) + '" title="' + escape(title) + '">' + insert + '</a>'); return (''); Where would I insert the code that you were telling me about? Thanks What is your version of prestashop? Link to comment Share on other sites More sharing options...
Recommended Posts