Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 ASP (Windows server) versions
 Exclude products from proddetail
Author « Topic »  

sparksm
Advanced Member

125 Posts

Pre-sales questions only
(More Details...)

Posted - 02/20/2023 :  12:10:27  
Is there a way to exclude or include a category from showing up on the proddetail page while still showing the products in other areas?

I'm not looking for a login level type solution.

Looking for something similar to what can be done with the product pages with parameters such as:
<% catid="91" %>
<% explicitid=91 %>

If this is not something that's currently possible, would it be something that could be easily added in the future?

dbdave
ECT Moderator

USA
10245 Posts

Posted - 02/20/2023 :  13:28:08  
Hi, can you explain a bit better. Categories do not show up on the detail pages, so can you clarify that.
Thanks,
David

sparksm
Advanced Member

125 Posts

Pre-sales questions only
(More Details...)

Posted - 02/20/2023 :  15:07:06  
It's a weird scenario where I have two different proddetail pages. I understand this is not the intended design, and not typically supported.

One of the files is my normal proddetail page, used for products.
The other file is what I call a blogdetail page, used for articles.

They each have their own styling, and a different setup. I've tried using both on just the proddetail page and it was more of a headache than just making them seperate (or so I thought when I first made this setup).

The issue is that, despite indicating a static url, some of my products have been crawled on my blogdetail page, and some of my articles have been crawled on my proddetail page.

My desired result is to 404 or redirect the article posts on proddetail and do the same for products appearing on blogdetail. All of my articles are in 1 category, and I was hoping to block the 1 category from appearing on proddetail, and conversely I want to only allow 1 category to show on the blogdetail page.

Again, I understand this is not a normal use case. The only fix I can think of at this point is to merge everything back to the single proddetail page and redirect the blogdetail page to it, and just live with a singular styling setup; though this is not the preferred outcome.

dbdave
ECT Moderator

USA
10245 Posts

Posted - 02/20/2023 :  17:42:14  
Yes, it sounds like you might be making extra work for yourself and damaging your SEO at the same time.

So I have an idea and I think something like this would probably do the trick.
The first thing is to be sure you have this line with your includes, usually at the top of your page, but after all the main include lines.
<!--#include file="vsadmin/inc/metainfo.asp"-->
This will give us the category name so we can check that and adjust the css as needed.

In the head of the page, but after that include line, you want something like this.

<%
'begin custom css for articles
if sectionname = "the exact name of your article category here" then
%>
<style type="text/css">
div.someclass {color:red;}
div.otherclass {font-weight:bold;color:blue;}
</style>
<%
end if
'end custom css for articles
%>


Give it a try to let me know if it's not working.
FYI - You could actually add or remove parameters there too, or change the order of the layout and things like that.

Thanks,
David

Edited by - dbdave on 02/20/2023 17:45:29

sparksm
Advanced Member

125 Posts

Pre-sales questions only
(More Details...)

Posted - 02/20/2023 :  20:31:32  
The extra work was minimal, and hasn't been an issue for the ~3 years I've been using it this way but yes there has been some SEO issues that have recently popped up.

If I wanted to pass through some parameters that would normally be in an include file, where would I put them in the code snippet that you just replied with and what would the syntax look like? If you have an example, that would be much appreciated.

Also, if you have any advice on web.config redirect from blogdetail to proddetail that would be very helpful too. I'm guessing it's something similar this but I have a feeling it's not exactly right:

<rule name="blog" stopProcessing="true">
<match url="^blogdetail\.asp$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{QUERY_STRING}" pattern="^at=(.*)$" />
</conditions>
<action type="Redirect" url="https://www.yoursite.com/proddetail.asp" appendQueryString="false" redirectType="Permanent" />
</rule>

dbdave
ECT Moderator

USA
10245 Posts

Posted - 02/21/2023 :  08:18:14  
Hi, I would need to research the redirect, but for the code, I have indicated where you can add parameters. and supplied some example and even some languagefile change examples.

<%
'begin custom css for articles
if sectionname = "the exact name of your article category here" then
'add any desired parameter changes below this line
detailpagelayout="navigation, checkoutbutton, productimage, productid,description, dateadded,previousnext, emailfriend"
crosssellsectionmax=9
socialmediabuttons="askaquestion,facebook,twitter,pinterest"
xxEFCmt="Your Question (Please try to be specific)"
xxAsqThk="Thank you, your message has been sent and we will get back to you as soon as possible."
%>
<style type="text/css">
div.someclass {color:red;}
div.otherclass {font-weight:bold;color:blue;}
</style>
<%
end if
'end custom css for articles
%>

dbdave
ECT Moderator

USA
10245 Posts

Posted - 02/21/2023 :  08:31:03  
As for the rewrite, there is the MS website here, which may or may not help you.
https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module

But I came up with this, although untested.

<rewrite>
<rules>
<rule name="blogdetail-REDIRECT" stopProcessing="true">
<match url="^blogdetail.asp" />
<conditions>
<add input="{QUERY_STRING}" pattern="prod=" negate="true" />
</conditions>
<action type="Redirect" url="proddetail.asp" appendQueryString="false" redirectType="Permanent" />
</rule>
</rules>
</rewrite>


You may just need to give it a go and run a test to see if it's working.
Thanks,
David

sparksm
Advanced Member

125 Posts

Pre-sales questions only
(More Details...)

Posted - 02/21/2023 :  10:21:50  
I just gave the styling and parameters a go and it seems to work. Much appreciated, I could have really used that years ago.

I'll play around with the re-write tonight and see if I can get it to work.

sparksm
Advanced Member

125 Posts

Pre-sales questions only
(More Details...)

Posted - 02/21/2023 :  23:01:13  
The web.config snippet that ended up working was:

<rule name="blogdetail-REDIRECT" stopProcessing="true">
<match url="^blogdetail(|\.asp)(|\?.*)$" />
<action type="Redirect" url="proddetail.asp{R:2}" appendQueryString="true" redirectType="Permanent" />
</rule>

I think I've got this under control now. Thanks a bunch dbdave!

dbdave
ECT Moderator

USA
10245 Posts

Posted - 02/22/2023 :  08:24:33  
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000