<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NemoPS &#187; cms</title>
	<atom:link href="https://nemops.com/tag/cms/feed/" rel="self" type="application/rss+xml" />
	<link>https://nemops.com</link>
	<description>Prestashop Tutorials, Modules and More!</description>
	<lastBuildDate>Wed, 05 Dec 2018 13:25:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.35</generator>
	<item>
		<title>Add private access to CMS pages in PrestaShop</title>
		<link>https://nemops.com/prestashop-private-access-cms/</link>
		<comments>https://nemops.com/prestashop-private-access-cms/#comments</comments>
		<pubDate>Wed, 28 Sep 2016 10:24:51 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[private]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2870</guid>
		<description><![CDATA[<p>In this tutorial we will see how to make cms pages private in PrestaShop, and only allow access to registered customers Watch the Screencast</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-private-access-cms/">Add private access to CMS pages in PrestaShop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this tutorial we will see how to make cms pages private in PrestaShop, and only allow access to registered customers<br />
<span id="more-2870"></span></p>
<h2>Watch the Screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/7eMotQyowpc" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-private-access-cms/">Add private access to CMS pages in PrestaShop</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-private-access-cms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to add hooks to Prestashop CMS pages</title>
		<link>https://nemops.com/how-to-hooks-prestashop-cms/</link>
		<comments>https://nemops.com/how-to-hooks-prestashop-cms/#comments</comments>
		<pubDate>Wed, 20 Aug 2014 07:57:24 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[prestashop]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=2120</guid>
		<description><![CDATA[<p>Prestashop CMS pages are useful, but lack the possibility of adding modules to any of them, specifically. Let&#8217;s see how to enhance these pages and create custom hooks for them! Creating a custom hook for CMS pages The first step is to create a new, custom hook and add it to the cms.tpl file. We [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/how-to-hooks-prestashop-cms/">How to add hooks to Prestashop CMS pages</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Prestashop CMS pages are useful, but lack the possibility of adding modules to any of them, specifically. Let&#8217;s see how to enhance these pages and create custom hooks for them!</p>
<p><span id="more-2120"></span></p>
<h2>Creating a custom hook for CMS pages</h2>
<p>The first step is to create a new, custom hook and add it to the <strong>cms.tpl</strong> file. We will be using the <a href="http://nemops.com/adding-hooks-to-prestashop-1-5/#.U_MS7fna6r0" title="new way to add hooks to Prestashop">new way to add hooks</a> introduced in Prestashop 1.5.</p>
<p>Locate your <strong>cms.tpl</strong> inside the theme&#8217;s folder, and open it up in any code editor. Please notice yours might look different from mine, as I am using Prestashop 1.6.0.8</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
{if isset($cms) &amp;&amp; !isset($cms_category)}
	{if !$cms-&gt;active}
		&lt;br /&gt;
		&lt;div id=&quot;admin-action-cms&quot;&gt;
			&lt;p&gt;
				&lt;span&gt;{l s='This CMS page is not visible to your customers.'}&lt;/span&gt;
				&lt;input type=&quot;hidden&quot; id=&quot;admin-action-cms-id&quot; value=&quot;{$cms-&gt;id}&quot; /&gt;
				&lt;input type=&quot;submit&quot; value=&quot;{l s='Publish'}&quot; name=&quot;publish_button&quot; class=&quot;button btn btn-default&quot;/&gt;
				&lt;input type=&quot;submit&quot; value=&quot;{l s='Back'}&quot; name=&quot;lnk_view&quot; class=&quot;button btn btn-default&quot;/&gt;
			&lt;/p&gt;
			&lt;div class=&quot;clear&quot; &gt;&lt;/div&gt;
			&lt;p id=&quot;admin-action-result&quot;&gt;&lt;/p&gt;
			&lt;/p&gt;
		&lt;/div&gt;
	{/if}
	&lt;div class=&quot;rte{if $content_only} content_only{/if}&quot;&gt;
		{$cms-&gt;content}
	&lt;/div&gt;
{elseif isset($cms_category)}
	&lt;div class=&quot;block-cms&quot;&gt;
		&lt;h1&gt;&lt;a href=&quot;{if $cms_category-&gt;id eq 1}{$base_dir}{else}{$link-&gt;getCMSCategoryLink($cms_category-&gt;id, $cms_category-&gt;link_rewrite)}{/if}&quot;&gt;{$cms_category-&gt;name|escape:'html':'UTF-8'}&lt;/a&gt;&lt;/h1&gt;
		{if $cms_category-&gt;description}
			&lt;p&gt;{$cms_category-&gt;description|escape:'html':'UTF-8'}&lt;/p&gt;
		{/if}
		{if isset($sub_category) &amp;&amp; !empty($sub_category)}	
			&lt;p class=&quot;title_block&quot;&gt;{l s='List of sub categories in %s:' sprintf=$cms_category-&gt;name}&lt;/p&gt;
			&lt;ul class=&quot;bullet list-group&quot;&gt;
				{foreach from=$sub_category item=subcategory}
					&lt;li&gt;
						&lt;a class=&quot;list-group-item&quot; href=&quot;{$link-&gt;getCMSCategoryLink($subcategory.id_cms_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}&quot;&gt;{$subcategory.name|escape:'html':'UTF-8'}&lt;/a&gt;
					&lt;/li&gt;
				{/foreach}
			&lt;/ul&gt;
		{/if}
		{if isset($cms_pages) &amp;&amp; !empty($cms_pages)}
		&lt;p class=&quot;title_block&quot;&gt;{l s='List of pages in %s:' sprintf=$cms_category-&gt;name}&lt;/p&gt;
			&lt;ul class=&quot;bullet list-group&quot;&gt;
				{foreach from=$cms_pages item=cmspages}
					&lt;li&gt;
						&lt;a class=&quot;list-group-item&quot; href=&quot;{$link-&gt;getCMSLink($cmspages.id_cms, $cmspages.link_rewrite)|escape:'html':'UTF-8'}&quot;&gt;{$cmspages.meta_title|escape:'html':'UTF-8'}&lt;/a&gt;
					&lt;/li&gt;
				{/foreach}
			&lt;/ul&gt;
		{/if}
	&lt;/div&gt;
{else}
	&lt;div class=&quot;alert alert-danger&quot;&gt;
		{l s='This page does not exist.'}
	&lt;/div&gt;
{/if}
&lt;br /&gt;
{strip}
{if isset($smarty.get.ad) &amp;&amp; $smarty.get.ad}
{addJsDefL name=ad}{$base_dir|cat:$smarty.get.ad|escape:'html':'UTF-8'}{/addJsDefL}
{/if}
{if isset($smarty.get.adtoken) &amp;&amp; $smarty.get.adtoken}
{addJsDefL name=adtoken}{$smarty.get.adtoken|escape:'html':'UTF-8'}{/addJsDefL}
{/if}
{/strip}

</pre>
<p>We first need to decide where to put our module, if before the cms content, or after it. Whichever position you choose (you might also add two hooks, one before, one after), the important section of the page is the following:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

&lt;div class=&quot;rte{if $content_only} content_only{/if}&quot;&gt;
	{$cms-&gt;content}
&lt;/div&gt;

</pre>
<p>I strongly advice to insert new hooks right outside the rte container block, to avoid cms styles to override the ones of any eventual module. At this point, let&#8217;s add the hook.</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

{hook h='customCMS'}

&lt;div class=&quot;rte{if $content_only} content_only{/if}&quot;&gt;
	{$cms-&gt;content}
&lt;/div&gt;

</pre>
<p>As you can see, I decided to add mine right before the cms content block. It is important to notice the <strong>$content_only</strong> variable. If you prefer the hook not to be executed when viewing the cms page in a lighbox, you need to wrap it inside an if statement:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">

{if !$content_only} 
{hook h='customCMS'}
{/if}

&lt;div class=&quot;rte{if $content_only} content_only{/if}&quot;&gt;
	{$cms-&gt;content}
&lt;/div&gt;

</pre>
<p>This way, if you hooked something to your terms and conditions, this hook will not be executed when displaying the specific cms page in the checkout popup.</p>
<div class="separator"></div>
<h2>How to hook Modules to CMS pages</h2>
<p>We have our custom hook. It&#8217;s time to decide which module we want to plug to a cms page.</p>
<p>Given that it cannot be done without modifying core module files (and by editing a native module we are not given the chance to upgrade it without losing modifications), to make our lives easier it&#8217;s generally a good idea to simply clone/call an existing hooking method.</p>
<p>In the example, I will use the <strong>Featured Products block</strong> module, to display the featured products list in a cms page (for no reason!). Therefore, open up <strong>homefeatured.php</strong>, located at <em>modules/homefeatured</em>, and then locate the install method:</p>
<pre class="brush: php; title: ; notranslate">
	public function install()
	{
		$this-&gt;_clearCache('*');
		Configuration::updateValue('HOME_FEATURED_NBR', 8);

		if (!parent::install()
			|| !$this-&gt;registerHook('header')
			|| !$this-&gt;registerHook('addproduct')
			|| !$this-&gt;registerHook('updateproduct')
			|| !$this-&gt;registerHook('deleteproduct')
			|| !$this-&gt;registerHook('categoryUpdate')
			|| !$this-&gt;registerHook('displayHomeTab')
			|| !$this-&gt;registerHook('displayHomeTabContent')
		)
			return false;

		return true;
	}
</pre>
<p>We called our hook <strong>customCMS</strong>, so we need to register this during the module&#8217;s install:</p>
<pre class="brush: php; title: ; notranslate">
	public function install()
	{
		$this-&gt;_clearCache('*');
		Configuration::updateValue('HOME_FEATURED_NBR', 8);

		if (!parent::install()
			|| !$this-&gt;registerHook('header')
			|| !$this-&gt;registerHook('addproduct')
			|| !$this-&gt;registerHook('updateproduct')
			|| !$this-&gt;registerHook('deleteproduct')
			|| !$this-&gt;registerHook('categoryUpdate')
			|| !$this-&gt;registerHook('displayHomeTab')
			|| !$this-&gt;registerHook('displayHomeTabContent')
			|| !$this-&gt;registerHook('customCMS')
		)
			return false;

		return true;
	}
</pre>
<p>Then, we need to add the hooking method at the end of the file, before the closing bracket</p>
<pre class="brush: php; title: ; notranslate">
	public function hookcustomCMS($params)
	{
		return $this-&gt;hookDisplayHome($params);
	}
</pre>
<p>This way, we are simply calling the default method used (not in 1.6, as that&#8217;s the tab one) to show the block in the homepage. We could as well clone the same method and change it as we prefer, of course (for example if we need to use another template), but this is the quickest way.</p>
<p>Save and reset the module, then navigate to any cms page:</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/08/custtom_cms_hooks.png"><img src="http://nemops.com/wp-content/uploads/2014/08/custtom_cms_hooks-663x1024.png" alt="How to add hooks to Prestashop CMS pages - Added featured products" width="663" height="1024" class="aligncenter size-large wp-image-2127" /></a></p>
<p>It&#8217;s displaying, and that&#8217;s fine. However, it&#8217;s being shown in every CMS page! How to deal with it?</p>
<div class="separator"></div>
<h2>Target specific cms page in the hooking method</h2>
<p>We obviously don&#8217;t want to display a module in every cms page, so we have to find a way to target each specific one. How? The quickest way is to use the CMS page ID, which is the number highlighted in the following screen.</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/08/urls.jpg"><img src="http://nemops.com/wp-content/uploads/2014/08/urls-680x34.jpg" alt="How to add hooks to Prestashop CMS pages - CMS ID in page urls" width="680" height="34" class="aligncenter size-large wp-image-2128" /></a></p>
<p>If you use friendly urls, the ID will precede the page&#8217;s slug, like <strong>1-delivery</strong>, where 1 is the ID. If not, the id is the number following <strong>id_cms=</strong> in the url.</p>
<p>Alternatively, it&#8217;s also displayed at the far left or the table listing all available cms pages, in the back office:</p>
<p><a href="http://nemops.com/wp-content/uploads/2014/08/custom_cms_list_bo.png"><img src="http://nemops.com/wp-content/uploads/2014/08/custom_cms_list_bo-680x310.png" alt="How to add hooks to Prestashop CMS pages - CMS ID in the  back office" width="680" height="310" class="aligncenter size-large wp-image-2130" /></a></p>
<p>Once we have this information, let&#8217;s use it in our new, custom hooking method:</p>
<pre class="brush: php; title: ; notranslate">
	public function hookcustomCMS($params)
	{

		if (Tools::getValue('id_cms') != 1)
			return;
		return $this-&gt;hookDisplayHome($params);
	}

</pre>
<p>And we are done! Try to navigate to other pages. In my case, I will only see the block if I view the Delivery Information CMS.</p>
<p>The post <a rel="nofollow" href="https://nemops.com/how-to-hooks-prestashop-cms/">How to add hooks to Prestashop CMS pages</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/how-to-hooks-prestashop-cms/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Prestashop 101 Day 13 &#8211; Prestashop CMS</title>
		<link>https://nemops.com/prestashop-cms/</link>
		<comments>https://nemops.com/prestashop-cms/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 10:10:25 +0000</pubDate>
		<dc:creator><![CDATA[Nemo]]></dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[prestashop]]></category>
		<category><![CDATA[prestashop 101]]></category>

		<guid isPermaLink="false">http://nemops.com/?p=1188</guid>
		<description><![CDATA[<p>In this video we will have a quick overview of then possibilities the Prestashop CMS package grants us, and try to create a blog-like structure in our store. Running time: 17 mins Prestashop version used: 1.5.3.1 &#160; All series&#8217; lessons Day 1 &#8211; Introducing and installing Prestashop Day 2 &#8211; Basic Prestashop Configuration Day 3 &#8211; [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-cms/">Prestashop 101 Day 13 &#8211; Prestashop CMS</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>In this video we will have a quick overview of then possibilities the Prestashop CMS package grants us, and try to create a blog-like structure in our store.<br />
<span id="more-1188"></span></p>
<p><strong>Running time: </strong>17 mins<br />
<strong>Prestashop version used:</strong> 1.5.3.1</p>
<div class="separator"></div>
<p>&nbsp;</p>
<h3>All series&#8217; lessons</h3>
<ul>
<li><a title="Prestashop 101 Day 1 – Introducing and installing Prestashop" href="http://nemops.com/prestashop-101-day-1-installing-prestashop/">Day 1 &#8211; Introducing and installing Prestashop</a></li>
<li><a title="Prestashop 101 Day 2 – Basic Prestashop Configuration" href="http://nemops.com/prestashop-101-prestashop-configuration/">Day 2 &#8211; Basic Prestashop Configuration</a></li>
<li><a title="Prestashop 101 Day 3 – Prestashop categories and products" href="http://nemops.com/prestashop-categories-and-products/">Day 3 &#8211; Prestashop categories and products</a></li>
<li><a title="Prestashop 101 Day 4 – Prestashop Attributes Combinations" href="http://nemops.com/prestashop-attributes/">Day 4 &#8211; Prestashop Attributes Combinations</a></li>
<li><a title="Prestashop 101 Day 5 – Prestashop Upgrade" href="http://nemops.com/prestashop-upgrade/">Day 5 &#8211; Prestashop Upgrade</a></li>
<li><a title="Prestashop 101 Day 6 – Prestashop Modules" href="http://nemops.com/prestashop-modules/">Day 6 &#8211; Prestashop Modules</a></li>
<li><a title="Prestashop 101 Day 7 – Prestashop Shipping, Zones and Countries" href="http://nemops.com/prestashop-shipping-zones-countries/">Day 7 &#8211; Prestashop Shipping, Zones and Countries</a></li>
<li><a title="Prestashop 101 Day 8 – Taxes, Currencies, Payments" href="http://nemops.com/prestashop-payments-currencies-taxes/">Day 8 &#8211; Taxes, Currencies, Payments</a></li>
<li><a title="Prestashop 101 Day 9 – Order Management" href="http://nemops.com/order-management/">Day 9 &#8211; Order Management</a></li>
<li><a title="Prestashop 101 Day 10 - Prestashop Customers" href="http://nemops.com/prestashop-customers/">Day 10 &#8211; Prestashop Customers</a></li>
<li><a title="Prestashop 101 Day 11 - Prestashop Discounts (Cart rules)" href="http://nemops.com/prestashop-discounts-cart-rules/">Day 11 &#8211; Prestashop Discounts (Cart rules)</a></li>
<li><a title="Prestashop 101 Day 12 - Prestashop Themes and visual tweaks" href="http://nemops.com/prestashop-themes/">Day 12 &#8211; Prestashop Themes and visual tweaks</a> </li>
<li>Day 13 &#8211; Prestashop CMS</li>
<li><a title="Prestashop 101 Day 14 - Prestashop SEO and Preferences" href=" http://nemops.com/prestashop-seo-and-preferences/">Day 14 &#8211; Prestashop SEO and Preferences</a> </li>
<li><a title="Prestashop 101 Day 15 - Prestashop Multistore" href=" http://nemops.com/prestashop-multistore/">Day 15 &#8211; Prestashop Multistore</a> </li>
</ul>
<h2>Watch the screencast</h2>

	<div class="video-embed">
		<iframe width="640" height="360" src="http://www.youtube.com/embed/PgFol_L1EWU" frameborder="0" allowfullscreen></iframe><p><a href="https://www.youtube.com/user/NemoPostScriptum/videos" rel="nofollow" title="Subscribe Post Scriptum's Youtube Channel">Subscribe Post Scriptum's Youtube Channel</a></p>	</div>
<h3>Additional Resources</h3>
<p><a href="http://nemops.com/enable-tinymce-commands-prestashop-1-5/" title="Quick Tip – Enable all tinyMCE commands in Prestashop 1.5" target="_blank">Quick Tip – Enable all tinyMCE commands in Prestashop 1.5</a></p>
<p>The post <a rel="nofollow" href="https://nemops.com/prestashop-cms/">Prestashop 101 Day 13 &#8211; Prestashop CMS</a> appeared first on <a rel="nofollow" href="https://nemops.com">NemoPS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://nemops.com/prestashop-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
