Jump to content

[SOLVED] How to change the header images in blocks?


Recommended Posts

hello
i want to change my block header images separately. I mean for example the "category" block has its own image and differs from "information" block and so on. (each block has its own header image).
how can i do this please tell me what rules or files must be changed?
thank you so much

Link to comment
Share on other sites

Hi,

the images of your template are in your folder themes>>prestashop>>img

Here you can change the header of your blocks.


no i said that i want each block have different image.
in this way that you said all of blocks will have the same image. i don't want this.
Link to comment
Share on other sites

Then you juste have to create
for each block and in your folder global.css, set those div to call the header images you want.

Eg:


i have a css and the code is as below:

div.categories h4 {
   font-family: Helvetica, Sans-Serif;
   font-weight: bold;
   font-size: 1.5em;
   text-align:left;
   padding-left:60px;
   padding-top:10px;
   line-height:40px;
   color: #255290;
   margin:0 auto;
   height:40px;
   background: url('../img/block-header-categories.jpg') no-repeat top;



and insert the image in "img" folder but still showing the default image and don't show the customized one. this is also repeat for other blocks and just showing the default.
just modifying the css is enough or must do some changes in other files of theme?

Link to comment
Share on other sites

You must change the tpl folder of the blocks and include your
in them.
Then you go to your global.cc folder and include the name of the
you created, calling the header image you want.


sory i dont know where in the tpl file must put this "div".
this is the tpl for categories:

{include file=$tpl_dir./breadcrumb.tpl} 
{include file=$tpl_dir./errors.tpl}

{if $category->id AND $category->active}
{strip}
       {$category->name|escape:'htmlall':'UTF-8'}

           {if $nb_products == 0}{l s='There are no products.'}
           {else}
               {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
               {$nb_products} 
               {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
           {/if}
{/strip}


   {if $scenes}
       <!-- Scenes -->
       {include file=$tpl_dir./scenes.tpl scenes=$scenes}
   {else}
       <!-- Category image -->
       {if $category->id_image}
getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
       {/if}
   {/if}

   {if $category->description}
{$category->description}
   {/if}
   {if isset($subcategories)}
   <!-- Subcategories -->

{l s='Subcategories'}

       {foreach from=$subcategories item=subcategory}

getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
                   {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" />
                   {else}

                   {/if}



getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}

       {/foreach}




   {/if}

   {if $products}
           {include file=$tpl_dir./product-sort.tpl}
           {include file=$tpl_dir./product-list.tpl products=$products}
           {include file=$tpl_dir./pagination.tpl}
       {elseif !isset($subcategories)}

{l s='There are no products in this category.'}
       {/if}
{elseif $category->id}

{l s='This category is currently unavailable.'}
{/if}



so where i must do changes and what i must wright? i mean must wright the "div" code i mentioned or full code for this in the css?
thank you so much for fast replying.

Link to comment
Share on other sites

You want to change the header of the block so for the categories block, you must change the file blockcategories.tpl in your blockcategorie module.

Change the file like this:

<!-- Block categories module -->

    
{l s='Categories' mod='blockcategories'}
 
Link to comment
Share on other sites

You want to change the header of the block so for the categories block, you must change the file blockcategories.tpl in your blockcategorie module.

Change the file like this:

<!-- Block categories module -->

    
{l s='Categories' mod='blockcategories'}
 


hello
it works for me thanks a lot. Of course in the module i must only change the "class" of block.
there isn't any thank button here so i press it for you, then i will say: thanks, thank, thanks.
Link to comment
Share on other sites

  • 3 months later...

Hello!

Thanks for your help - I had a similar problem with my block headers, and I tried what you suggested above.
Somehow the block header titles still come up above the images and cuts the image off where the text ends...
Is there a way to turn those titles off, or if not, remove them for good?

Thank again,
T

Link to comment
Share on other sites

  • 10 months later...

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...