Sitemap on home page

How would I go about including the store sitemap on my store homepage?

CS-Cart 1.3.5sp2.

Many thanks


if you want it to be on the homepage with your current welcome text, then just update the contents.tpl skin

at the bottom there is this code:


{include file=“welcome.tpl”}


just change to:


{include file=“welcome.tpl”}

{include file=“sitemap_pages/sitemap.tpl”}


didnt try this myself - so make copy of your current content.tpl - and if you want to just show the site map and not the welcome text, then remove the welcome include

good luck


Thanks for your reply.

This displays the sitemap ‘box’ but not the sitemap itself.



what do you mean by the box and not the sitemap?

anyone had any luck with this yet?

Linking to the tpl doesnt work as the variable target=sitemap needs to be passed for it to work I think

I think you’re right about that target=sitemap thing.

Here is the code for targets/sitemap.php

```php if ( !defined(‘IN_CSCART’) ) { die(‘Access denied’); }

if (AREA == ‘C’) {

include CUSTOMER_DIR . ‘sitemap.php’;

} elseif (AREA == ‘A’) {

include ADMIN_DIR . ‘sitemap.php’;

} ```

Here is the code for include/customer/sitemap.php

```php if ( !defined(‘IN_CSCART’) ) { die(‘Access denied’); }

$sitemap_settings = fn_get_settings_section(‘Sitemap’);

$smarty->assign(‘sitemap_settings’, $sitemap_settings);

/** Body /

if ($sitemap_settings[‘show_cats’] == ‘Y’) {

if ($sitemap_settings[‘show_rootcats_only’] == ‘Y’) {

$sitemap[‘categories’] = $root_categories;

} else {

$sitemap[‘categories_tree’] = fn_get_plain_categories_tree(0, true);



$custom_sections = fn_get_sitemap_sections();

foreach($custom_sections as $k => $section) {

$links = db_get_array(“SELECT link_id, link_href, section_id, avail, position, link_type, description, object as link FROM $db_tables[sitemap_links] LEFT JOIN $db_tables[common_descriptions] ON $db_tables[common_descriptions].object_id=$db_tables[sitemap_links].link_id AND $db_tables[common_descriptions].object_table=‘$db_tables[sitemap_links]’ AND $db_tables[common_descriptions].lang_code=‘$cart_language’ WHERE section_id=‘$section[section_id]’ ORDER BY position, link”);

if (!fn_is_empty($links)) {

foreach($links as $key => $link) {

$sitemap[‘custom’][$section[‘section’]][$key][‘link’] = $link[‘link’];

$sitemap[‘custom’][$section[‘section’]][$key][‘link_href’] = $link[‘link_href’];

$sitemap[‘custom’][$section[‘section’]][$key][‘description’] = $link[‘description’];





$smarty->assign(‘sitemap’, $sitemap);

$smarty->assign(‘content’, ‘sitemap’);

if ($sitemap_settings[‘show_sideboxes’] != ‘Y’) {

$smarty->assign(‘hide_sideboxes’, 1);


/Body /

Functions **/


// This function returns the site map links list


function fn_get_sitemap_sections() {

global $db_tables, $cart_language;

$common_descr_query = fn_common_descr_query($db_tables[‘sitemap_sections’], ‘section_id’, $cart_language);

return db_get_array(“SELECT *, object as section FROM $db_tables[sitemap_sections] LEFT JOIN $db_tables[common_descriptions] ON $common_descr_query WHERE avail=‘Y’ ORDER BY position, section”);

} ```

How can i do this in the Cs-Cart v2.1?

Please i need some help…:confused:

Best regards,