Jump to content

Moving category title & description overlay off category image


Recommended Posts

I recently updated to 1.6.x and ran into the problem with the category titles and description being on top my category images. I understand that is a new feature, but it didn't fit with my existing images so I had to figure out how to move them back above the image. The link below is the old discussion related to the topic with no resolution besides removing category images all together or redoing all images. 
 

 

 

Here's what worked for me (default theme). I'm an amateur so it's entirely possible that there is a better way to do this and I'd be glad to hear criticism. 

 

Category.tpl

   <!-- Category image -->
                    <div class="content_scene_cat_bg" >
                        {if $category->description}
                            <div class="cat_desc">
							
                            <span class="category-name">
                                {strip}
                                    {$category->name|escape:'html':'UTF-8'}
                                    {if isset($categoryNameComplement)}
                                        {$categoryNameComplement|escape:'html':'UTF-8'}
                                    {/if}
                                {/strip}
                            </span>
							
                            {if Tools::strlen($category->description) > 350}
                                <div id="category_description_short" class="rte">{$description_short}</div>
                                <div id="category_description_full" class="unvisible rte">{$category->description}</div>
                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>

                            {else}
							
                                <div class="rte">{$category->description}</div>

                            {/if}
							
						<div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) center no-repeat; min-height:{$categorySize.height}px;"{/if}>
					
						</div> 
                            </div>

                        {/if}

                     </div>
					
                  {/if}
				  
            </div>
			
		{/if}

To work correctly on mobile or lower res screens I had to add two lines to category.css

 

Category.css

  .content_scene_cat .content_scene_cat_bg {
     background-size: contain !important;
     padding: 1px 10px 10px 14px;
	 background-color: #464646 !important; }
    @media (max-width: 1199px) {
      .content_scene_cat .content_scene_cat_bg {
	min-height: 250px !important;
        padding: 10px 10px 10px 15px; } }

post-723697-0-00299300-1439776677_thumb.png

Edited by jwbc46 (see edit history)
Link to comment
Share on other sites

you can do with css only

edit the global.css in themes/default-bootstrap/css/

 

add this lines at the end

 

.cat_desc{

 

 

  1. positionrelative;
  2. floatleft;
  3. clearboth;
  4. margin-top128px;
  5. width100%;

}

 

#center_column h1 {

  1. font-size1.5em;
  2. text-transformcapitalize;
  3. width100%;
  4. clearboth;
}
 
 
the margin-top need to be changed if your category images are bigger
Edited by shacker (see edit history)
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...