Prod Scroller - Search Engine Results - Template

  • kampala
    Inactive member
  • Topic Author
  • Member
  • Member
More
10 years 8 months ago #31403 by kampala
Hi, I am using the VM Product Scroller on my home page - it works well but there is one odd side effect that has me puzzled. I have two different templates applied to my site one for the home page and one for product detail pages. If I click via the product scroller to view a product all is well and product details page displays as intended. HOWEVER, the scroller appears to generate product detail pages that are found by search engines (thats great) - BUT when one follows the search engine links to the product detail pages they are displayed with the wrong template ie the home page template rather than the product details template. How can I ensure that correct template is applied to these pages OR how can I exclude these "psuedo" pages from search engines results.

Please Log in to join the conversation.

More
10 years 8 months ago #31411 by ivan.milic
You have two templates and you use menu template assignment. Links can carry menu item id so joomla knows which menu item delegation to use. You can edit helper.php to modify place where link is formed to insert Itemid=XX

where Itemid will be menu item to take template assignment from.

Please Log in to join the conversation.

  • kampala
    Inactive member
  • Topic Author
  • Member
  • Member
More
10 years 8 months ago #31425 by kampala
Thanks for prompt response Ivan.

Can you please clarify which piece of code I should be adding a menu id to - I am not sure where "links" are being formed. I have listed the helper.php code from the vm product scroller module below but unsure which lines to tackle. Please advise.


/*
# "Hot VM Scroller" - Joomla Module
# Copyright (C) 2012 ArhiNet d.o.o. All Rights Reserved.
# License: www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
# Author: HotJoomlaTemplates.com
# Website: www.hotjoomlatemplates.com
*/

if(!window.initvmscroller){
window.initvmscroller = function(){
(function (jQuery, undefined) {
jQuery.widget("hjt.hotvmscroller", {
options: {
speed: 1500,
delay: 5000,
transition: 'easeOutQuad',
direction: 'vertical',
fade: 'no',
onComplete: function(){},
onStart: function(){}
},
items: null,
auto: null,
current: 0,
el:null,
_create: function () {
var self = this,
options = self.options;
var el = self.el = jQuery(this.element);
self.items = el.find('LI');

var w = 0;
var h = 0;

if (self.options.direction.toLowerCase() == 'horizontal') {
h = el.innerHeight();
self.items.each(function (ind) {
w += (jQuery(this).innerWidth() + parseInt(jQuery(this).css('marginLeft')) + parseInt(jQuery(this).css('marginRight')) + 5);
})
} else {
w = el.innerWidth();
self.items.each(function (ind) {
h += (jQuery(this).innerHeight() + parseInt(jQuery(this).css('marginTop')) + parseInt(jQuery(this).css('marginBottom')) + 5);
})
}


if (self.options.fade == "yes") {
this.el.css({
position: 'absolute',
top: 0,
left: 0,
width: w + 'px',
height: h + 'px',
opacity: 1
});


} else {
this.el.css({
position: 'absolute',
top: 0,
left: 0,
width: w + 'px',
height: h + 'px'
});

}
self.resume();
},
pause: function(){
var self = this;
if(self.auto){
window.clearInterval(self.auto);
self.auto = null;
}
},
resume: function(){
var self = this;
if(!self.auto){
self.auto = window.setInterval(function () {
self.next();
}, self.options.delay);
}
},
next: function(){
var self = this;
self.current++;
if (self.current >= self.items.length) self.current = 0;
var a = jQuery(self.items[self.current]);
if (this.options.fade == "yes") {
self.el.animate({
top: -a[0].offsetTop,
left: -a[0].offsetLeft,
opacity: 1
},
self.options.speed ,
self.options.transition,
function () {
var i = (self.current == 0) ? self.items.length : self.current;
jQuery(self.items[i - 1]).parent().appendTo(self.el);
self.el.css({
left: 0,
top: 0
});
}
);
} else {
self.el.animate({
top: -a[0].offsetTop,
left: -a[0].offsetLeft
},
self.options.speed ,
self.options.transition,
function () {
var i = (self.current == 0) ? self.items.length : self.current;
jQuery(self.items[i - 1]).parent().appendTo(self.el);
self.el.css({
left: 0,
top: 0
});
}
);
}
},
_setOption: function (key, value) {
this.options[key] = value;
},

destroy: function () {
jQuery(this.element).html(this._baseHTML);
jQuery.Widget.prototype.destroy.call(this);
}
}); // widget
})(jQuery);

if(window.onscrollerinit){
onscrollerinit();
}

};

if(jQuery.widget){
initvmscroller();
}else{
var tmo = window.setTimeout( function(){
if(jQuery.widget){
initvmscroller();
window.clearTimeout(tmo);
}
},100);
}
}

Please Log in to join the conversation.

More
10 years 8 months ago #31438 by ivan.milic
modules\mod_vmscroller\helper.php

line ~390:

$product_link = JRoute::_($pr->link);

add:

$product_link .= '&Itemid=XX'
The following user(s) said Thank You: kampala

Please Log in to join the conversation.

  • kampala
    Inactive member
  • Topic Author
  • Member
  • Member
More
10 years 8 months ago #31462 by kampala
Thanks Ivan .. I understand the code far better now

Please Log in to join the conversation.

Time to create page: 0.463 seconds
Powered by Kunena Forum