Free blog module for PrestaShop Create your free blog with PrestaShop
Free blog for PrestaShop, will allow you to display pages added with the module as a list of entries divided by category. In addition, thanks to special hooks you will be able to display the list of recent entries anywhere in your store. The module is based on the native system of adding content pages in stores based on PrestaShop engine. Blog adds additional fields to the form when editing the page, which allows you to create additional views and advanced layouts that will visually enrich your store. The module creates a table in the database which stores entries related to the content of the store, in order for the page to be considered a blog entry you just need to check the analogous option, during editing. Blog allows you to edit the content and meta data of the main category, which helps to create a list of entries and is good for the store's SEO. The blog uses container queries so it will easily adapt to any block in your store.
The blog is free, but requires an annotated link directing to the creator's site. The version shown is a test version, not a production version, so use it at your own risk.
Shortcut:
- Link to module demo
- Link to GIT repository
- Link to the package (better to download the module from the GIT repository)
Module functionalities:
- Adds a list of defined fields to the PrestaShop page edit form
- Allows you to display a carousel of entries anywhere on your store
- Allows you to edit the content and metadata of the store's main category
- It has a RWD system so that it adapts to the block it is in rather than the screen
- Allows you to switch between categories of entries
- Does not affect store performance
The module requires editing of .tpl files, however, these are minor modifications, but require basic knowledge of the SMARTY language.
Installing a blog for PrestaShop
Installing the Blog module for PrestaShop is easy and fun. By default, you need to download the installation package with the CompsoulBlog module. Then, install it through the module manager on the backend of the store. To place the attachment in the list of categories on the store, we need to edit the file themes/[nazwa szablonu]/templates/cms/category.tpl adding a hook {hook h='displayCompsoulBlogPages' category=$cms_category pages=$cms_pages}
preferably where the blog will be able to display the full width of the page.
To display a list of the last few entries as a carousel or slider, we need to use the following hook: {hook h="displayCompsoulBlogFeatured"}
, we can place it anywhere as it should adjust automatically. However, it looks best placed in blocks of full screen width.
The last file we need to edit (don't look at me like that PrestaShop doesn't provide any hooks in there to hook into), is a file themes/[nazwa szablonu]/templates/cms/page.tpl. The attachment added there is responsible for displaying the expansion of our file {hook h='displayCompsoulBlogPage' cms=$cms}
. Again, placing the clip where it can spread its wings across the full width of the screen works best.
Installation process in steps
- Download the Blog module package, available for download here
- Install the Blog module through the module manager on the backend of the store
- Put the hook
{hook h='displayCompsoulBlogPages' category=$cms_category pages=$cms_pages}
in the file themes/[template name]/templates/cms/category.tpl - Put the hook
{hook h='displayCompsoulBlogFeatured'}
in any file. In the demo, a file was edited themes/[template name]/templates/index.tpl - Put the hook
{hook h='displayCompsoulBlogPage' cms=$cms}
in the file themes/[template name]/templates/cms/page.tpl - Add the first entry and indicate that it is a blog post
If you need help with the installation or configuration of the blog module, please contact us. We are ready to help you with any issue. It is also possible to implement and customize the blog module for a fee, for more information, please visit our store.
Downloading the package with the blog module
If you want to add a blog module to your PrestaShop store, you must first download a package with the appropriate version of the module. Remember to make a backup of your store before installation. If you experience any problems or wish to report new functionality, please contact us.
Installation of the Compsoul Blog module
You can add the downloaded package with the Blog module to the store's administration panel. To do this, log into the backend of the store, select the "Modules" tab in the left menu column, and then "Module Manager". In the upper right corner, click the "Load Module" button, and then place or select the module file: compsoulblog.zip.
Once the module is installed correctly, you will receive a message about the successful installation, and then you can proceed to its configuration.
Hooks
The display of individual templates is done by adding hooks. List of default hooks in the blog module:
{hook h='displayCompsoulBlogPages' category=$cms_category pages=$cms_pages}
- an attachment responsible for displaying all entries in a category. It must be added to the list of categories to pass the appropriate variables.{hook h='displayCompsoulBlogPage' cms=$cms}
- thanks to it, you can display the blog expansion and additional fields defined in the php code of the module. Default CSS styles will allow you to arrange the content in an interesting way. The attachment as a parameter accepts the page settings through which it can retrieve from the database our entry of interest, thus it must be added in the template responsible for displaying the content of CMS pages.{hook h='displayCompsoulBlogFeatured'}
- the attachment is used to display recent entries anywhere on the store. The number of displayed entries can be set in the module settings.
Below is a list of hooks, along with an example of their placement in each template:
category.tpl
The attachment must be added in the themes/[template name]/templates/cms/category.tpl file so that it can pass the appropriate parameters. In addition, in the example shown, the default category and subcategory list blocks have been removed. However, there is nothing preventing you from using them together with the blog module. Below is the sample code I use in the module demo:
{extends file='page.tpl'}
{block name='page_title'}
{$cms_category.name}
{/block}
{block name='page_content'}
{hook h='displayCompsoulBlogPages' category=$cms_category pages=$cms_pages}
{block name='cms_sub_categories'}{/block}
{block name='cms_sub_pages'}{/block}
{/block}
page.tpl
The attachment is added in themes/[template name]/templates/cms/page.tpl file to pass the appropriate parameters. The example added in the demo additionally contains blocks where a page with content that does not contain a blog post can be displayed:
{extends file='page.tpl'}
{block name='page_content_container'}
{block name='compsoul_blog_page'}
{hook h='displayCompsoulBlogPage' cms=$cms}
{/block}
{if !empty($cms.content)}
<section id="content" class="container content content-{$cms.id} module module-page">
{block name='cms_content'}
{$cms.content nofilter}
{/block}
{block name='hook_cms_dispute_information'}
{hook h='displayCMSDisputeInformation'}
{/block}
{block name='hook_cms_print_button'}
{hook h='displayCMSPrintButton'}
{/block}
</section>
{/if}
{/block}
index.tpl
We can place the hook anywhere on the page, in the demo it was placed on the home page just before the footer:
{extends file='page.tpl'}
{block name='page_content_container'}
{block name='page_content_top'}{/block}
{block name='page_content'}
{block name='hook_home'}
{$HOOK_HOME nofilter}
{hook h='displayCompsoulBlogFeatured'}
{/block}
{/block}
{/block}
This code can be easily customized, but keep in mind that this module can work in different places on the page, so the HTML code must be adjusted accordingly.
Adding new entries
After proper installation of the module, on the backend of our store, in the Design -> Pages, we have the possibility to add a new CMS page using the "Add New Page" button. The module extends the CMS page form with new fields that we can fill in with any content. The new CMS page will appear in the list after checking the box: "Is the entry part of a blog?" which tells the module whether to treat the page as a blog entry. Thanks to this treatment, we can add pages with content not belonging to a blog that can work as before.
Thank you
In summary, the free Blog module for PrestaShop allows you to expand the default presentation of content in your store systems. The module includes default styles and scripts that can be easily customized for your store. Please note that the module is a test version and using it is at your own risk. The module's settings allow you to edit the content and metadata of the CMS main category of your PrestaShop store. Before installing the module, it is recommended to make a backup of the store. The article will be displayed when the show on blog option is set when editing the CMS page in the store.