Jump to content

[Solved] Removing link (a href) on CMS title


Recommended Posts

I'm a new Prestashop user and noticed that when clicking on CMS block title "Information" a new page opens with all the CMS pages I created.

 

Since I'm using two CMS blocks with absolutely no connection between each other, It would be great if I could remove the link on the title of both the CMS blocks to avoid showing that messy page with all the CMS pages.

 

Is it possible to remove that <a href> on the CMS block title?

 

If not, is there a way to assin each CMS page correctly to each CMS block and just show the ones I selected and not all of them?

 

Thanks in advance.

Miguel

Link to comment
Share on other sites

Yes this is possible go to modules/blockcms and edit the blockcms.tpl file.

At the very top you should see lines like this, the red text needs to be removed from the line. (h4 line)

 

(change this)

<!-- Block CMS module -->

{foreach from=$cms_titles key=cms_key item=cms_title}

<div id="informations_block_left_{$cms_key}" class="block informations_block_left">

<h4><a href="{$cms_title.category_link}">{if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}</a></h4>

<ul class="block_content">

 

(to this)

<!-- Block CMS module -->

{foreach from=$cms_titles key=cms_key item=cms_title}

<div id="informations_block_left_{$cms_key}" class="block informations_block_left">

<h4>{if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}</h4>

<ul class="block_content">

Link to comment
Share on other sites

  • 1 year later...

Hi

 

in prestashop 1.5.3.1 is not working. i have this code:

 

<!-- Block CMS module -->

{foreach from=$cms_titles key=cms_key item=cms_title}

<div id="informations_block_left_{$cms_key}" class="block informations_block_left">

<h4 class="title_block"><a href="{$cms_title.category_link}">{if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}</a></h4>

<ul class="block_content">

{foreach from=$cms_title.categories item=cms_page}

{if isset($cms_page.link)}<li class="bullet"><b style="margin-left:2em;">

<a href="{$cms_page.link}" title="{$cms_page.name|escape:html:'UTF-8'}">{$cms_page.name|escape:html:'UTF-8'}</a>

</b></li>{/if}

{/foreach}

{foreach from=$cms_title.cms item=cms_page}

{if isset($cms_page.link)}<li><a href="{$cms_page.link}" title="{$cms_page.meta_title|escape:html:'UTF-8'}">{$cms_page.meta_title|escape:html:'UTF-8'}</a></li>{/if}

{/foreach}

{if $cms_title.display_store}<li><a href="{$link->getPageLink('stores')}" title="{l s='Our stores' mod='blockcms'}">{l s='Our stores' mod='blockcms'}</a></li>{/if}

</ul>

</div>

{/foreach}

<!-- /Block CMS module -->

 

any help please?

Link to comment
Share on other sites

  • 3 weeks later...

Hi Tdr170! I've tried your solution... but it's not working for me. Should i regenerate templates after doing this or something like that?

Thanks!

 

Yes this is possible go to modules/blockcms and edit the blockcms.tpl file.

At the very top you should see lines like this, the red text needs to be removed from the line. (h4 line)

 

(change this)

<!-- Block CMS module -->

{foreach from=$cms_titles key=cms_key item=cms_title}

<div id="informations_block_left_{$cms_key}" class="block informations_block_left">

<h4><a href="{$cms_title.category_link}">{if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}</a></h4>

<ul class="block_content">

 

(to this)

<!-- Block CMS module -->

{foreach from=$cms_titles key=cms_key item=cms_title}

<div id="informations_block_left_{$cms_key}" class="block informations_block_left">

<h4>{if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}</h4>

<ul class="block_content">

Link to comment
Share on other sites

Hi

 

in prestashop 1.5.3.1 is not working. i have this code:

 

<!-- Block CMS module -->

{foreach from=$cms_titles key=cms_key item=cms_title}

<div id="informations_block_left_{$cms_key}" class="block informations_block_left">

<h4 class="title_block"><a href="{$cms_title.category_link}">{if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}</a></h4>

<ul class="block_content">

{foreach from=$cms_title.categories item=cms_page}

{if isset($cms_page.link)}<li class="bullet"><b style="margin-left:2em;">

<a href="{$cms_page.link}" title="{$cms_page.name|escape:html:'UTF-8'}">{$cms_page.name|escape:html:'UTF-8'}</a>

</b></li>{/if}

{/foreach}

{foreach from=$cms_title.cms item=cms_page}

{if isset($cms_page.link)}<li><a href="{$cms_page.link}" title="{$cms_page.meta_title|escape:html:'UTF-8'}">{$cms_page.meta_title|escape:html:'UTF-8'}</a></li>{/if}

{/foreach}

{if $cms_title.display_store}<li><a href="{$link->getPageLink('stores')}" title="{l s='Our stores' mod='blockcms'}">{l s='Our stores' mod='blockcms'}</a></li>{/if}

</ul>

</div>

{/foreach}

<!-- /Block CMS module -->

 

any help please?

 

 

Should be the text in red that needs to be removed, make sure after editing you enable force compile and turn cache off in the BO.

This will force a page refresh.

Link to comment
Share on other sites

Hi Tdr170! I've tried your solution... but it's not working for me. Should i regenerate templates after doing this or something like that?

Thanks!

 

You're most likely getting cached pages make sure you turn force compile on and cache of in the back office and reload the page.

Link to comment
Share on other sites

You're most likely getting cached pages make sure you turn force compile on and cache of in the back office and reload the page.

 

Hi, thanks for your help! Tried turning off CACHE and force compile ON as you said. I'm still getting no change. Maybe I'm modifying the wrong page? I'm working on themes/PRS040096/modules/blockcms

 

Thanks again!

Link to comment
Share on other sites

Just in case anybody is looking for the same issue, I've just solved.

I edited blocktopmenu.php in /modules/blocktopmenu. I changed line 545 inside the case "CMS_CAT", I left it like this:

 

$this->_menu .= '<li><a href="#">'.$category->name.'</a>';

 

It works just fine!

 

Thanks tdr170 for your time!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...