I'm using the following code to create inline text links to categories based on their ID:

{{widget type="catalog/category_widget_link" anchor_text="Some text" title="Some text" template="catalog/category/widget/link/link_inline.phtml" id_path="category/###"}}

This way, the links go directly to the store category without having to use the URL. But the problem is, I need these links to open in a new browser tab. Since I'm not using <a href=""> to create the links, I can't use the HTML target attribute to direct them to open in a new tab.

Does Magento have a target attribute equivalent for these types of links created with this widget?

1 Answer 1


You can just copy to your theme folder and edit this catalog/category/widget/link/link_inline.phtml template:

<span class="widget widget-category-link-inline"><a target="_blank" <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a></span>

Also you can create your custom template with this code and set path to this template in widget tag:

{{widget .. template="path_to_your/template.phtml" .. }}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.