Monday , October 7 2024

How to remove the link from the logo for the main page in CS Cart

By default, all pages in the site header have a link from the logo to the home page. According to some SEO audits, it is recommended to remove the particular link to the home page from the logo.

In CS Cart, the logo file is placed in /design/themes/template/templates/blocks/static_templates/logo.tpl

To solve the problem, this block:

<a href="{""|fn_url}" title="{$logos.theme.image.alt}">
        <img src="{$logos.theme.image.image_path}" width="{$logos.theme.image.image_x}" height="{$logos.theme.image.image_y}" alt="{$logos.theme.image.alt}" class="ty-logo-container__image" />
    </a>

should be replaced with this one:

{if !($runtime.controller == 'index' && $runtime.mode == 'index')}
<a href="{""|fn_url}" title="{$logos.theme.image.alt}">
{/if}
  <img src="{$logos.theme.image.image_path}" width="{$logos.theme.image.image_x}" height="{$logos.theme.image.image_y}" alt="{$logos.theme.image.alt}" class="ty-logo-container__image" />
{if !($runtime.controller == 'index' && $runtime.mode == 'index')}
</a>
{/if}

About admin

Hi there! My name is Iryna, I am a web developer from Ukraine. While working on freelance projects I often face different technical issues and in this blog I publish articles on how to solve them. I am also interested in digital drawing and in this blog you will find brief tutorials that helped me and hopefully can help you as well.

Check Also

How to change the width for Vk and Facebook widgets from pixels to percentages

Very often I need to replace a narrow widget, which for some reason is assigned …

Leave a Reply

Your email address will not be published. Required fields are marked *