Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Theme design problem core.loadable.js H1 tag

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 09-03-2014, 01:29 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Theme design problem core.loadable.js H1 tag

Hi all, I have run into a problem with skins/common/js/core.loadable.js

Inside this file you will find this function:
Code:
// Place new page title ALoadable.prototype.placeNewPageTitle = function(title) { if (this.updatePageTitle) { jQuery(this.titlePattern).eq(0).html(title); } if (this.updateBreadcrumb) { jQuery('#breadcrumb .last').find('a,span').html(title); } };

This function replaces the page title on the Cart page once cart is emptied. If in my markup I have an H1 tag located above the page title, say in the header of the page, this function will replace that H1 tag instead of the standard one. This should probably be addressed by more specifically targeting the page title H1.

In the meantime I need to replace core.loadable.js with my own code, or override it somehow. What would be your preference for overriding this code in my custom module? I am not building a skin module, but there are instances where my module will create an H1 tag in the header due to the admin's settings and theme choices. How can I get around this obstacle in the most elegant and maintainable way?
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #2  
Old 09-03-2014, 09:36 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Theme design problem core.loadable.js H1 tag

You need to make the following code loaded (the getJSFiles() method) on pages where you want to change the behavior:
Code:
ALoadable.prototype.titlePattern = '[jquery_selector_to_the_h1_tag_to_be_updated]';

I believe this should work.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions

Last edited by qualiteam : 09-03-2014 at 09:45 PM.
Reply With Quote

The following user thanks qualiteam for this useful post:
totaltec (09-03-2014)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:30 AM.

   

 
X-Cart forums © 2001-2020