Page 1 of 1

Disignated CategoryGridPage below article.

Posted: Wed Feb 15, 2012 6:44 pm
by jhmac
Hello All
I have a question.
How would I create a CategoryGridPage that pulled up a designated sub-category. I want to create a page about a vendor and have a CategoryGridPage with the sub-category below the article. I want to call it with something like [[ConLib:Custom\CategoryGridPageSpecialVendor]] or something like that. Is this even possible?
thanks in advance.
jh

Re: Disignated CategoryGridPage below article.

Posted: Wed Feb 15, 2012 9:56 pm
by david-ebt
Do you already have a category set up for this vendor with their products? If so, take a look at the .CS file for the CategoryGridPages you'll find a section of code beginning

Code: Select all

public int CategoryId
If you don't have the SearchSideBar active on your page, then this code uses the PageHelper.GetCategoryId() function which is in the app_code\PageHelper.cs file.

That function will look on the query string for CategoryId=#### where the #### is your category number. If you do have a category with this vendor's product already set up, you can browse to that category in admin and click on the preview button. It will give you the SEO-friendly URL.

Will that do what you want or do you need something more complex?

Re: Disignated CategoryGridPage below article.

Posted: Thu Feb 16, 2012 4:39 pm
by jhmac
Thanks for the help david.
I found the code you we talking about on the .cs file.
public int CategoryId
{
get
{
if(_SearchSidebar != null && _SearchSidebar.CategoryId > 0) return _SearchSidebar.CategoryId;
if (ViewState["CategoryId"] == null)
ViewState["CategoryId"] = PageHelper.GetCategoryId();
return (int)ViewState["CategoryId"];
}
set
{
ViewState["CategoryId"] = value;
}
}
I assume I do have the SearchSidebar active since it is being referenced in the code on the .ascx page
<%@ Register Src="~/ConLib/CategorySearchSidebar.ascx" TagName="CategorySearchSidebar" TagPrefix="uc" %>
where do i put the SEO-friendly url?

Can I have many categoryGridPages for all of the vendors I want to do articles on and just change the url for each sub-category I want to link to. I do not really want them to be linked in the sidebar, just from a "<a href="url"></a>" on the front page.
thanks again,
jh

Re: Disignated CategoryGridPage below article.

Posted: Fri Feb 17, 2012 10:50 am
by david-ebt
If you're setting up categories to hold these vendors, you can create a new top level category called VENDORS and then create a new sub-category for each of your vendors. Just make the VENDORS category Hidden and it won't show up in your category tree. You will want the sub-categories to be Public.

While in the Browse Category area in admin, just click on the preview button for each vendor sub-category and you'll see the SEO-friendly URL.

What version of Able are you using?