PrestaShop 1.3 Theming – Beginner’s Guide
上QQ阅读APP看书,第一时间看更新

Time for action—Modifying block names

  1. Go to Back Off i ce | Tools | Translations.
  2. In the Modify translations section, all parts of the translation are listed in a drop-down menu. You need to select Modules translations .
  3. Next, click on the particular language flag icon. For example, click on the American flag for English. You will have to browse through the listing for the expressions you want to change. Imagine that you are looking to change the INFORMATION block to FAQS , which initially looks like the following screenshot:
  4. Go to prestashop-blockinfos-9 expressions . Enter the word you want to replace; in this case, Information is replaced by FAQs .
  5. Finally, click on the Update translations button.

What just happened?

Here we learned how to change the name of a block. In the previous exercise, you modified a block name from INFORMATION to FAQS .

Have a go hero—Removing the "Powered by PrestaShop" at the footer link

We have not really started looking into the PrestaShop files. Nevertheless, this is a minor edit that you can easily perform without much technical knowledge.

You may need to remove the Powered by PrestaShop located at the footer link. Removal of this link is often requested by clients.

You will need an editor (such as Notepad or Dreamweaver) to open and edit the correct file to remove the Powered by PrestaShop line, as you cannot do it through the back office panel.

There are two ways of "removing" the Powered by PrestaShop line .

The first method involves editing or removing the line. This can be done by looking up and removing the relevant lines within the blockvariouslinks.tpl file.

The file is located at: /modules/blockvariouslinks/blockvariouslinks.tpl .

Copy this particular file to your themes folder. You should have this kind of link to the blockvariouslinks.tpl after you have copied it to the theme file (in this case, the theme folder name is theme1 ; you have to find it in your own theme folder).

For the theme1 that I have, the file path should look something like this:

/themes/theme1/modules/blockvariouslinks/blockvariouslinks.tpl

You will have to look up your own theme file accordingly.

Look for this code in the blockvariouslink.tpl file:

 <li class="last_item">{l s='Powered by' mod='blockvariouslinks'} <a href="http://www.PrestaShop.com">PrestaShop</a>&trade;</li> 

After removing it, save the file.

Another method of "removing" the link involves not deleting the lines but commenting them. This is common for those familiar with the HTML method of commenting on files. This is particularly useful when you need to look back at your files later as you will find it much faster to decipher the code in your pages.

To comment out lines in HTML, you can insert the starting comment tag, which is <!-- (that's the 'lesser than' sign followed by an exclamation mark and two dashes) and the ending tag, which is --> . The browser does not display any text placed between these tags.

However, a better solution in PrestaShop is to use the Smarty comment tags {* and *} instead of the HTML tags <!— and --> . By using Smarty comments, the code is ignored when the HTML is generated.

When you use <!-- and --> , the code is still visible when you view the source of the website and is unnecessarily downloaded.

Although it is allowed by PrestaShop to delete the whole line, commenting it out is a good choice, both as a reference for future editors and as a way to maintain the information intact in acknowledging the developers' effort in their free contributions to your final work.

In the end, the line would look like this.

{*
<li class="last_item">{l s='Powered by' mod='blockvariouslinks'} <a href="http://www.PrestaShop.com">PrestaShop</a>&trade;</li>
*}

You can also modify or delete the code we mentioned and instead replace it inserting <!--Powered By PrestaShop--> or {*Powered by PrestaShop*}