Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Changing the padding of a block in the left column

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 11-17-2015, 09:21 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Changing the padding of a block in the left column

I have the news module in the left column but the text was squashed into a narrow column due to the high values for the css padding in sidebar_box.tpl.

To change this layout, I created a file NewsBoxWithModifiedSidebarbox.php and saved it with the other class files in my theme. The file looks like this...

Code:
<?php namespace XLite\Module\Customer\CustomerTheme\View; class NewsBoxWithModifiedSidebarbox extends \XLite\Module\XC\News\View\TopNewsSideBar implements \XLite\Base\IDecorator { /** * Return default template * * @return string */ protected function getDefaultTemplate() { return 'modules/Customer/CustomerTheme/newsbox.tpl'; } }

This changes the normal sidebar_box.tpl template declared in XLite/View/SideBarBox to my own template at modules/Customer/CustomerTheme/newsbox.tpl.

My template...
Code:
<div class="{getBlockClasses()}"> <div class="head-h2" IF="getHead()">{t(getHead())}</div> <div class="content" style="padding:0 10px 20px 0px; font-size:13px"><widget template="{getBody()}"></div> </div>

I've used inline CSS to override the normal padding (temporary fix) and now my text has more horizontal space to flow.

This might not be the best way to do this but I thought I'd share in case someone is looking for the same thing.
__________________
Core version: 5.5.xx
Reply With Quote

The following user thanks xgarb for this useful post:
razortw (11-20-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:17 AM.

   

 
X-Cart forums © 2001-2020