Prev | Current Page 310 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

Open the presentation/templates/products_list.tpl file, and modify it as highlighted:
{* products_list.tpl *}
{load_presentation_object filename="products_list" assign="obj"}
{if count($obj->mProductListPages) > 0}


{if $obj->mLinkToPreviousPage}
Previous page
{/if}
CHAPTER 7 ?–  SEARCH ENGINE OPTIMIZATION 211
{section name=m loop=$obj->mProductListPages}
{if $obj->mPage eq $smarty.section.m.index_next}
{$smarty.section.m.index_next}
{else}
{$smarty.section.m.index_next}
{/if}
{/section}
{if $obj->mLinkToNextPage}
Next page
{/if}


{/if}
{if $obj->mProducts}


{section name=k loop=$obj->mProducts}
{if $smarty.section.k.index % 2 == 0}

{/if}
3. Load TShirtShop, and navigate to the Regional department. In Figure 7-6, you can see the new pagination links.
Figure 7-6. The SEO pagination links
CHAPTER 7 ?–  SEARCH ENGINE OPTIMIZATION 212
How It Works: Pagination
With this little trick implemented, your catalog is now easily browsable by both human visitors and electronic visitors.
Users will certainly appreciate the aid in quickly navigating to individual product pages, and search engines
will find those pages much easier to find and index as well.


Pages:
298299300301302303304305306307308309 310 311312313314315316317318319320321322