开发者

Prestashop - custom template link

I'm starting with "PrestaShop" and I just can't figure out, how to put a link in template to custom page I created in CMS module... I thought, there might be some easy way, as there is in WordPress, like "get_permalink(ID)", but there's nothing like this and I can't find anything about this anywhere and it just drives me mad.

So, here's the deal, I've got a custom template, and there are some top links, like "About Us". I've created this page in CMS and it has ID "6".

How do I make this bloody "PrestaShop" to generate a link to this page in my template file?

<a href="WHAT GOES H开发者_C百科ERE">About</a>


I think you're looking for SMARTY template tags and custom variables defined for Prestashop specifically. The one the you probably need is {$base_dir} which will be translated to http://www.yoursite.com/ obviously with appropriate protocol (non-secure HTTP or secured HTTPS).

After that, you only need to include page URL, which you can get from Admin->Tools->CMS section.

If I find any specific tags that you can use to call the content, I will update my post here.


<a href="{$link->getCMSLink('YOUR_PAGE_ID')}">Your Text</a>


the "WHAT goes here" is just the url you want your link drives the client to when clicking on that link.

You need to understand a little minimum of HTML for this I guess. Check html tag a meaning .

Prestashop has a fairly good and extensive documentation. Two and half seconds googling drives me here, just like answering your question it looks like.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜