Developer forum

Forum » Templates » Metatags on empty category with subcategories

Metatags on empty category with subcategories

Mads Andersen
Reply
Hi

I've run into some issues with metatags (title, keywords, description) does not show on empty categories with subcategories.
The reason why is, when no products found on the category I list the subcategories in the "NoProductsFound" template. The "NoProductsFound" template has no metatags and the categorys tags gets overwritten by the current page's tags.
It's a huge problem that I can't SEO optimize the top categories pages.

The question is now:

Is there any other way to list the subcategories than from the "NoProductsFound" template and what's the correct way to do it?
And how do I ensure that the metatags from the category with no products will be shown?

Replies

 
Nicolai Høeg Pedersen
Reply
If this is the case, it is a bug.

I'll have our QA take a look and file a bug if reproduced.

 
Mads Andersen
Reply
 Thank you.

Please let me know if it is a bug :-)
 
Merethe Nielsen
Reply
Hi

Did you try the Subgroups loop? I get these tags inside that loop:
  <!--@Ecom:Group.MetaDescription-->
  <!--@Ecom:Group.MetaKeywords-->
  <!--@Ecom:Group.MetaTitle-->
  <!--@Ecom:Group.MetaUrl-->

Add this to your "No products" template:


---------------------------------------------------
<!--@LoopStart(Subgroups)--><!--@DwTemplateTags-->
  <!--@Ecom:Group.MetaDescription-->
  <!--@Ecom:Group.MetaKeywords-->
  <!--@Ecom:Group.MetaTitle-->
  <!--@Ecom:Group.MetaUrl-->


<li class="listitem<!--@Groups.LoopMod2-->">
        <h3><a href="<!--@Ecom:Group.Link.Clean-->"><!--@Ecom:Group.Name--></a></h3>
        <span class="shortdescription"><!--@Ecom:Group.Description--></span>
    </li>
<!--@LoopEnd(Subgroups)-->
No product found

---------------------------------------------------
   
Mads Andersen
Reply
Thanks, but that is not quite the answer I'm looking for. I would like the whole template to be tagged with the parent category metatags and not the non existend tags from the NoProductsFound template.

I was aware that the tags were available :-)

I'm also looking for an alternative way, if any, to show the child categories when there's no products and only child categories.

But thank you :-) 
 
Merethe Nielsen
Reply

I'm sorry that I misunderstood you. I now get it and was able to reproduce it.

I have created bug 7220.

I talked to Nicaoli and we don't think that there is a workaround.

 

 
Mads Andersen
Reply
 Thank you, sorry for my bad explaining :-)

 

You must be logged in to post in the forum