Blog

Coast Creative provides Adobe Business Catalyst e-commerce web development services and SEO for website
designers and online business owners.

Taming the text node in BC pagination

Tuesday, June 04, 2013

The built in pagination tag for BC works great but it's painful to style even for a simple thing like underlining the current page number. The only way to deal with it is to dive in to jQuery and modify the markup once it's loaded in the DOM.

Here's a snippet of code that works great for the purpose:

$(function(){
$('.pagination').contents().each(function(){
if (this.nodeType === 3 && this.nodeValue !== null && /[0-9]+/.test(this.nodeValue)) {
$(this).replaceWith(' '+$.trim(this.nodeValue)+' ')
}
});
});

If you would like more information on this topic and BC pagination wizardry in general you can head over to kiyuco.com.They have several tutorials on this subject. Well worth the money if you're an aspiring Business Catalyst developer.

Comments