Pagination giving "ghost" links...

General ShopSite user discussion

Pagination giving "ghost" links...

Postby lordofdirt » Mon Jun 02, 2008 9:59 am

When I limit the number of products to display on a page I get the header "page name" with the numbers for the generated pages. Under these numbers I have a link to a page that does not exist on my site and one going to msn. I don't want these links, how can I fix it?



</div>
<p align="left"><font face="Times New Roman">[-- PAGE.Text1 --]</font></p>
<p align="left"><font face="Times New Roman">[-- PAGE.Text2 --]</font></p>
<p align="left"><font face="Times New Roman">[-- PAGE.Text3 --]</font></p>

<h2 style="text-align:center">[-- PAGE.Name --]</h2>

[-- IF PAGE.ProductsPerPage 0 --]
# do nothing
[-- ELSE --]
<p style="text-align:center">[-- PrevNext --]</p>
[-- END_IF --]
[-- IF PAGE.DisplayPageFooter --]
[-- FOOTER --]
[-- END_IF --]
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby loren_d_c » Mon Jun 02, 2008 10:30 am

Do you have an example address to a page with this problem so we could see it?

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby lordofdirt » Mon Jun 02, 2008 10:39 am

lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby loren_d_c » Mon Jun 02, 2008 10:50 am

I don't think that these links come as the result of the pagination links. The HTML code that creates these 'ghost' links in the source of that page is distinctly after the pagination links. The HTML looks like something that would be created by Microsoft FrontPage:

Code: Select all
<center><small>
<A HREF="NAV4.HTML">HOME</A>
<A HREF="HTTP://WWW.MSN.COM">MSN</A>
<center><small>


My guess is either you have this HTML in the custom HTML you have placed in your footer (see Preferences -> Page Header & Footer), or in one of the other fields in this Page record (such as Text 1, Text 2, or Text 3), or you edited this page via Microsoft FrontPage after it was generated by ShopSite and that was how this bogus code was added.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby lordofdirt » Mon Jun 02, 2008 10:51 am

Thanks! I should have no problem fixing that. I'll let you know either way.
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby lordofdirt » Mon Jun 02, 2008 11:13 am

Alright man, thanks alot, it worked.

Now for another problem that's bugging me. On pages without products I still get the page name in h1 font, at the bottom of the page. I thought the code nulled it out if product count = 0

[-- IF PAGE.ProductsPerPage 0 --]
# do nothing
[-- ELSE --]
<h2 style="text-align:center">[-- PAGE.Name --]</h2>
<p style="text-align:center">[-- PrevNext --]</p>
[-- END_IF --]
[-- IF PAGE.DisplayPageFooter --]
[-- FOOTER --]
[-- END_IF --]


http://www.americannutrition.com/store/ ... _care.html
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby loren_d_c » Mon Jun 02, 2008 11:35 am

[-- IF PAGE.ProductsPerPage 0 --] does not check to see if there are products on the page, rather it checks the 'Number of Products per generated page' pagination setting in your Page record.

If you want to see if there are products assigned to the page or not, try something like [-- IF PAGE.NumProducts 0 --].

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby lordofdirt » Mon Jun 02, 2008 11:43 am

So if I want to get rid of that header at the bottom of pages with 0 products I could say...


[-- IF PAGE.ProductsPerPage 0 --]
# do nothing
[-- IF PAGE.ProductsPerPage 0 --]
# do nothing

[-- ELSE --]
<h2 style="text-align:center">[-- PAGE.Name --]</h2>
<p style="text-align:center">[-- PrevNext --]</p>
[-- END_IF --]
[-- IF PAGE.DisplayPageFooter --]
[-- FOOTER --]
[-- END_IF --]

Will this work? I just want to get rid of that redundant heading if no products are on the page.
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am

Postby loren_d_c » Mon Jun 02, 2008 11:51 am

No, you probably should't do it like that, for one you used the wrong IF tag again, and you don't have a matching end if for it. You would probably be better off with something like:


Code: Select all
[-- IF PAGE.ProductsPerPage 0 --]
# do nothing
[-- ELSE --]
     [-- IF PAGE.NumProducts 0 --]
#do not output the Page Name
     [-- ELSE --]
#there are products, so output the page name
     <h2 style="text-align:center">[-- PAGE.Name --]</h2>
     [-- END_IF --]
<p style="text-align:center">[-- PrevNext --]</p>
[-- END_IF --]

[-- IF PAGE.DisplayPageFooter --]
[-- FOOTER --]
[-- END_IF --]


Or there are probably several other ways to couch the logic to accomplish the same thing.

And this is assuming that it is the [-- PAGE.Name --] that you don't want to display if there are products on the page.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby jake12 » Mon Jun 02, 2008 12:00 pm

Nice website you have :)
jake12
 
Posts: 16
Joined: Mon Feb 04, 2008 9:10 am

Postby lordofdirt » Mon Jun 02, 2008 12:29 pm

thanks jake!

And thanks for all the help. Things are running smoothly now.
lordofdirt
 
Posts: 40
Joined: Fri May 16, 2008 8:19 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 84 guests