apex1 Posted October 15, 2011 Share Posted October 15, 2011 I'm hoping someone can tell me how I can insert the google font api code into the header file of my site. It seems that whatever changes I make in header.tpl do not take effect. Just trying to insert a simple snippet of code so that I can change the font in my nav bar. Link to comment Share on other sites More sharing options...
phrasespot Posted October 15, 2011 Share Posted October 15, 2011 No need to mess with the template files. If your installation is compatible, download this module. Disclosure: module is built by me. Install. Visit Back Office > Modules > Front Office Features > Multi Block ... > Configuration. Select Header of Pages in drop down and paste your snippet in the Block Body field. Save. You are ready to go. Read module's help section for more information and examples. 1 Link to comment Share on other sites More sharing options...
berka.pavel Posted October 15, 2011 Share Posted October 15, 2011 when you change something in your tpl theme file, you have to delete tools > smarty > cache and compile (don´t delete index.php files) Link to comment Share on other sites More sharing options...
apex1 Posted October 15, 2011 Author Share Posted October 15, 2011 No need to mess with the template files. If your installation is compatible, download this module. Disclosure: module is built by me. Install. Visit Back Office > Modules > Front Office Features > Multi Block ... > Configuration. Select Header of Pages in drop down and paste your snippet in the Block Body field. Save. You are ready to go. Read module's help section for more information and examples. I have no idea how to install it Link to comment Share on other sites More sharing options...
phrasespot Posted October 15, 2011 Share Posted October 15, 2011 Download the module's zip file from the link I gave to your computer. Login to back office, click on Modules tab, then Add a module from my computer. Click Browse... button next to Module file field, navigate to folder where you downloaded the zip file, select it, then click Upload this module. Here is a summary screen capture. It should take few seconds and the module will be added to the list of the modules. Look under Front Office Features on the same page to find the module (you might need to reset the module filter to show all modules). Then follow the instructions from my previous post. Post here if you have any problems. What berka.pavel said may work as well if that is the problem and if you don't want to use the module. Link to comment Share on other sites More sharing options...
apex1 Posted October 15, 2011 Author Share Posted October 15, 2011 Wow, thank you so much for your help!! I realized that my mistake before was that I was not saving it, rather I was opening the file and extracting to my computer. Thank you! Link to comment Share on other sites More sharing options...
apex1 Posted October 15, 2011 Author Share Posted October 15, 2011 Now, last question: How can I go back and undo changes that I made? Link to comment Share on other sites More sharing options...
phrasespot Posted October 15, 2011 Share Posted October 15, 2011 You delete the hook used, (each position is actually a hook provided by Prestashop). Go to Back Office > Modules > Positions, select Show Multi Block ... and check Display non-positionable hooks as module can hook non-positionable hooks. Then either check the relevant hook and select Unhook the selection or click on the bin icon to delete it (summary screen capture). Post if you have any problems. Link to comment Share on other sites More sharing options...
philee Posted October 15, 2011 Share Posted October 15, 2011 Great stuff Phrasespot as always! Link to comment Share on other sites More sharing options...
neeno Posted October 16, 2011 Share Posted October 16, 2011 Hum, and what if user wants only to add aditional CSS declaration without using any modules ? Which file holds the css declarations ? Link to comment Share on other sites More sharing options...
phrasespot Posted October 16, 2011 Share Posted October 16, 2011 There is not a single file that holds all CSS declarations. Depending on what modules are loading, what page you are seeing etc eventual CSS files loaded will differ. It is also dependent on whether it is a module related CSS file, theme related CSS file or Prestashop's core CSS file. The default installation of Prestashop has 120+ CSS files loaded from 40+ locations, and loading of these are scattered throughout the codebase. It is however possible to manually modify one or more core files to load an additional CSS if you want to do it manually. Though I am not sure why would you do it that way as it becomes a maintenance headache. If you explain what you are trying to do I may be help. Link to comment Share on other sites More sharing options...
neeno Posted October 16, 2011 Share Posted October 16, 2011 Well i'm having font problems as OP mentioned. The design for the shop was created separately and was already confirmed by the customer. So this design contains custom font wich means i either have to somehow integrate the font, or generate different images for each block header (this font is used for block headers) wich then becomes pain in the ass for maintenance. So going from this, i wanted to integrate google's font API's link rel somewhere. Any other ideas on the matter or suggestions would be highly appreciated. Link to comment Share on other sites More sharing options...
Velici Posted September 13, 2013 Share Posted September 13, 2013 Disclosure: module is built by me. Install. Visit Back Office > Modules > Front Office Features > Multi Block ... > Configuration. Select Header of Pages in drop down and paste your snippet in the Block Body field. Save. You are ready to go. Read module's help section for more information and examples. Where is the link to this Module?? Link to comment Share on other sites More sharing options...
vekia Posted September 13, 2013 Share Posted September 13, 2013 this module isn't free anymore. you can do it with free html block module of with free content block module tutorial here: google fonts and prestashop Link to comment Share on other sites More sharing options...
Velici Posted September 13, 2013 Share Posted September 13, 2013 this module isn't free anymore. you can do it with free html block module of with free content block module tutorial here: google fonts and prestashop THANKS! Link to comment Share on other sites More sharing options...
karlspezial2 Posted May 14, 2014 Share Posted May 14, 2014 (edited) this module isn't free anymore. you can do it with free html block module of with free content block module tutorial here: google fonts and prestashop I am trying to develop my own design for prestashop and minimized it. There are a few questions - regarding google font api too. By default there is a google font loaded directly from google server. This is bad as it allows google to track users and could be avoided by copying fonts to local server. So I found this in "header.tpl". First I copied the initial theme provided by installation to my own theme and make changes here. Is it safe to edit files like header.tpl for example to delete this google style as link rel ? Does it correspond with eventually new versions of prestashop ? Second - I found that in the default theme a lot of modules are activated and about a dozen or more css files are loaded. This is not very fast to do it this way. Is there a chance to add all css files automatically to a one and only file or at least two, a core css and a css for all modules. This could be done by software. The default behaviour increases load for first time visitors significantly which results in bad speed (even when running on a fast server). Edited May 14, 2014 by karlspezial2 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 15, 2014 Share Posted May 15, 2014 Is it safe to edit files like header.tpl for example to delete this google style as link rel ? you can remove these lines, you don't have to worry about potential problems, because these lines arent important. Does it correspond with eventually new versions of prestashop ? if you changing default theme - it will be overwrited after update, so it's worth to move default theme from default-bootstrap to other directory (then you will not lose changes) Second - I found that in the default theme a lot of modules are activated and about a dozen or more css files are loaded. This is not very fast to do it this way. Is there a chance to add all css files automatically to a one and only file or at least two, a core css and a css for all modules. This could be done by software. The default behaviour increases load for first time visitors significantly which results in bad speed (even when running on a fast server). yes, under adv. parameters > performance tab you can run CCC for css files this feature will minify all css files, and then - combine them into one file 1 Link to comment Share on other sites More sharing options...
karlspezial2 Posted May 15, 2014 Share Posted May 15, 2014 yes, under adv. parameters > performance tab you can run CCC for css files this feature will minify all css files, and then - combine them into one file Hey - that's great news. Tried it and worked. Thanks, I didn't expect it to work that easy. Link to comment Share on other sites More sharing options...
vekia Posted May 16, 2014 Share Posted May 16, 2014 indeed, prestashop has got more awesome features like cdn support etc. it's worth to deal with these options, you can easily increase performance of shop Link to comment Share on other sites More sharing options...
karlspezial2 Posted May 16, 2014 Share Posted May 16, 2014 Yes I saw your options in performance tuning but wasn't aware that this has effect on includes of css files. Content delivery is a matter of cost - but nice to have the option to use. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now