Filtering Links to Page

General ShopSite user discussion

Filtering Links to Page

Postby Craig » Fri Apr 21, 2006 6:54 am

Hi,

This is my first post since I am new to Shopsite. I have used several
carts on my site that I have had online since 1999.

Here's my first question.

I want to filter some links for the front page and place them in
different locations on the page. I want to have a "Shop By Brand" area
on the page and a "Shop By State" area on the page.

I know how to do this using SQL but need some assistance to accomplish
this in Shopsite. By the way, does anyone know which database Shopsite uses?

I am thinking of using one of the extra page fields for labeling a page
as a brand or a state. I would then use an IF statement to tell Shopsite
whether or not to display the link to the page.

Has anyone done this and be willing to share their code?

Thanks,
Craig Peterson
Craig
 

Re: Filtering Links to Page

Postby jim » Sat Apr 22, 2006 11:03 am

In a custom template you can have more than one section. You would
need to setup the extra page fields to indicate brand or state. In your
page template you would set a VAR to indicate which links you want
displayed in each location like this.
# this is where I want my brands displayed
[-- VAR.link_type "BRAND" --]
[-- Loop Links --]
[-- link --]
[-- END_Loop Links --]

# This is where I want the states
[-- VAR.link_type "STATES" --]
[-- Loop Links --]
[-- link --]
[-- END_Loop Links --]

In the [-- DEFINE LINK_TO_PAGE --] section of the template used to
display the links you would have something like this

[-- DEFINE LINK_TO_PAGE --]
[-- IF VAR.link_type PRODUCT.FIELD1 --]
# do whatever formatting is necessary to output the link when the value
# of VAR.link_type and product.field 1 match

[-- ELSE --]
# do what ever other formatting you might want to do if the values don't
# match. So this section could be blank if you don't want to do
# anything.
[-- END_IF --]

[-- END_DEFINE LINK_TO_PAGE --]

This is a very basic version so you will need to flesh it out to meet
your needs.

Jim

Craig wrote:

Hi,

This is my first post since I am new to Shopsite. I have used several
carts on my site that I have had online since 1999.

Here's my first question.

I want to filter some links for the front page and place them in
different locations on the page. I want to have a "Shop By Brand" area
on the page and a "Shop By State" area on the page.

I know how to do this using SQL but need some assistance to accomplish
this in Shopsite. By the way, does anyone know which database Shopsite
uses?

I am thinking of using one of the extra page fields for labeling a page
as a brand or a state. I would then use an IF statement to tell Shopsite
whether or not to display the link to the page.

Has anyone done this and be willing to share their code?

Thanks,
Craig Peterson
jim
 

Re: Filtering Links to Page

Postby Craig » Mon Apr 24, 2006 3:29 pm

Thanks for the info Jim. This will put me on the right track. One more
question. Can these links be automatically sorted alphabetically?


jim wrote:
In a custom template you can have more than one section. You would
need to setup the extra page fields to indicate brand or state. In your
page template you would set a VAR to indicate which links you want
displayed in each location like this.
# this is where I want my brands displayed
[-- VAR.link_type "BRAND" --]
[-- Loop Links --]
[-- link --]
[-- END_Loop Links --]

# This is where I want the states
[-- VAR.link_type "STATES" --]
[-- Loop Links --]
[-- link --]
[-- END_Loop Links --]

In the [-- DEFINE LINK_TO_PAGE --] section of the template used to
display the links you would have something like this

[-- DEFINE LINK_TO_PAGE --]
[-- IF VAR.link_type PRODUCT.FIELD1 --]
# do whatever formatting is necessary to output the link when the value
# of VAR.link_type and product.field 1 match

[-- ELSE --]
# do what ever other formatting you might want to do if the values don't
# match. So this section could be blank if you don't want to do
# anything.
[-- END_IF --]

[-- END_DEFINE LINK_TO_PAGE --]

This is a very basic version so you will need to flesh it out to meet
your needs.

Jim

Craig wrote:

Hi,

This is my first post since I am new to Shopsite. I have used several
carts on my site that I have had online since 1999.

Here's my first question.

I want to filter some links for the front page and place them in
different locations on the page. I want to have a "Shop By Brand" area
on the page and a "Shop By State" area on the page.

I know how to do this using SQL but need some assistance to accomplish
this in Shopsite. By the way, does anyone know which database Shopsite
uses?

I am thinking of using one of the extra page fields for labeling a
page as a brand or a state. I would then use an IF statement to tell
Shopsite whether or not to display the link to the page.

Has anyone done this and be willing to share their code?

Thanks,
Craig Peterson
Craig
 

Re: Filtering Links to Page

Postby jim » Mon Apr 24, 2006 9:29 pm

You can sort the page items (in a Pro store) using one of 2 methods.
Pages > Arrange items
or
Pages > Edit Page Layout > Page Arrangement Settings.

You cannot specify the sort order when the page is being generated by
the template, it must be done using one of the above methods.

Jim

Craig wrote:
Thanks for the info Jim. This will put me on the right track. One more
question. Can these links be automatically sorted alphabetically?


jim wrote:
In a custom template you can have more than one section. You would
need to setup the extra page fields to indicate brand or state. In
your page template you would set a VAR to indicate which links you
want displayed in each location like this.
# this is where I want my brands displayed
[-- VAR.link_type "BRAND" --]
[-- Loop Links --]
[-- link --]
[-- END_Loop Links --]

# This is where I want the states
[-- VAR.link_type "STATES" --]
[-- Loop Links --]
[-- link --]
[-- END_Loop Links --]

In the [-- DEFINE LINK_TO_PAGE --] section of the template used to
display the links you would have something like this

[-- DEFINE LINK_TO_PAGE --]
[-- IF VAR.link_type PRODUCT.FIELD1 --]
# do whatever formatting is necessary to output the link when the value
# of VAR.link_type and product.field 1 match

[-- ELSE --]
# do what ever other formatting you might want to do if the values don't
# match. So this section could be blank if you don't want to do
# anything.
[-- END_IF --]

[-- END_DEFINE LINK_TO_PAGE --]

This is a very basic version so you will need to flesh it out to meet
your needs.

Jim

Craig wrote:

Hi,

This is my first post since I am new to Shopsite. I have used several
carts on my site that I have had online since 1999.

Here's my first question.

I want to filter some links for the front page and place them in
different locations on the page. I want to have a "Shop By Brand"
area on the page and a "Shop By State" area on the page.

I know how to do this using SQL but need some assistance to
accomplish this in Shopsite. By the way, does anyone know which
database Shopsite uses?

I am thinking of using one of the extra page fields for labeling a
page as a brand or a state. I would then use an IF statement to tell
Shopsite whether or not to display the link to the page.

Has anyone done this and be willing to share their code?

Thanks,
Craig Peterson
jim
 


Return to User Forum

Who is online

Users browsing this forum: No registered users and 136 guests