X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Rounded Corners - Almost there but not quite (https://forum.x-cart.com/showthread.php?t=11818)

wayfarer 01-29-2005 03:45 PM

Rounded Corners - Almost there but not quite
 
Hi all,

I'm trying to round the bottom corners of my dialog.tpl dialog box and am almost there. I am trying to insert a 3 column table with corner graphics on either side. So far I have my left graphic where I want it but the right corner image is half way along the box. I am assuming that there is a two column structure somewhere in behind this and that the image is conforming to the edge of the first column, but I just can't seem to get the code right to deal with it (I am used to working in WYSIWYG and am a little rusty on hard coding in notetab).

Here's my dialog.tpl (working with 4.0.4, standard theme):

Code:

{* $Id: dialog.tpl,v 1.19 2004/06/24 09:53:29 max Exp $ *}
{if $printable ne ''}
{include file="dialog_printable.tpl"}
{else}
<TABLE border="0" cellpadding="0" cellspacing="0" {$extra}>
<TR>
<TD style= "border-right: 1px solid #9C9EAA; border-bottom: 1px solid #9C9EAA;" height="23" class="DialogTitle" background="{$ImagesDir}/dialog_bg_n.gif" valign="middle">{$title}</TD>
</TR>
<TR><TD style= "border-right: 1px solid #9C9EAA; border-left: 1px solid #9C9EAA;" class="DialogBorder"><TABLE border="0" cellpadding="10" cellspacing="0" width="100%">
<TR><TD class="DialogBox">{$content}
 
</TD></TR>
</TABLE><tr>
<td colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="white">
<tr>
<td width="9">
<div align="left">
[img]{$ImagesDir}/smalldialogcnr_left.gif[/img]</div>
</td>
<td></td>
<td width="9">
<div align="right">
[img]{$ImagesDir}/smalldialogcnr_right.gif[/img]</div>
</td>
</tr>
</table>
</td>
</tr>
</td><TD></TR>
</TABLE>
{/if}



And here's an example of the result:

http://www.wayfarer.co.nz/forumexamples/images/cornersdemo.gif

What should I change to get that pesky right hand corner graphic over to the right where it belongs?

balinor 01-29-2005 06:01 PM

You have an empty cell between the two corner images:

<td></td>

Put a spacer gif in there or at least define the cell width and add a

That should fix the problem.

Also, FYI you can paste a template into Dreamweaver or your favorite WYSIWYG editor to help you view some of the more complex nested tables. It can't read Smarty, but it can at least give you an idea of what cell is what :)

wayfarer 01-29-2005 06:38 PM

:D Great thanks! I've got it sussed now. I didn't think I could give the central cell a value, because I want it to expand and contract with the browser. But I gave it a value of 100% and it did the trick!

eaglemobiles 01-30-2005 06:20 AM

Hi, wayfarer
 
I want the same style could you please post your code so i can put in my store please.

Thanks

balinor 01-30-2005 06:29 AM

He did, it is right there at the top of the thread :)

eaglemobiles 01-30-2005 06:31 AM

But i dont know how make that changes you told him, Many thanks for reply

Nice one

balinor 01-30-2005 06:34 AM

Replace:

<td></td>

with

<td width="100%></td>

You are also going to need to create your own rounded corner .gif images.

eaglemobiles 01-30-2005 06:52 AM

Here is my code but I dont know how to make is round corner,

{* $Id: dialog.tpl,v 1.19 2004/06/24 09:53:29 max Exp $ *}
{if $printable ne ''}
{include file="dialog_printable.tpl"}
{else}
<TABLE border="0" cellpadding="0" cellspacing="0" {$extra}>
<TR>
<TD height="15" class="DialogTitle" background="{$ImagesDir}/dialog_bg_n.gif" valign="bottom">{$title}</TD>
</TR>
<TR><TD class="DialogBorder"><TABLE border="0" cellpadding="10" cellspacing="1" width="100%">
<TR><TD class="DialogBox">{$content}

</TD></TR>
</TABLE></TD></TR>
</TABLE>
{/if}

balinor 01-30-2005 06:56 AM

I'm afraid you are not going to just be able to copy his code, you are going to need to create your own .gif images for the rounded corners. If you don't know how to do that, you can do a search on the web and find quite a few examples/tutorials.

eaglemobiles 01-30-2005 06:59 AM

Ok thanks, I will, to sort it out as i am new to this coding stuff.

Thanks for your time

balinor 01-30-2005 07:11 AM

A couple of tips for you if you really want to become adept at editing X-Cart templates:

1. Learn HTML. Not just a WYSIWYG editor, but the real code of HTML. It is a very straightforward programming language, and you can pick it up pretty quickly.

2. Learn CSS. All of the styles in X-Cart (colors, fonts, etc) are controlled by CSS.

The O'Reilly books are great if you are looking for a reference. Good luck!

eaglemobiles 01-30-2005 07:17 AM

Thanks for your help, i will be grateful if you help me out, i have made some changes to login manu, now i want to bring the forgot password text near to join go but i cant do it, and I want to remove the go button from join i want it same as forgot password.

Thanks

nfc5382 01-30-2005 08:26 AM

any difference for 3.5?

Vern 01-21-2006 12:48 PM

Closing the bottom & rounding the corners
 
Thanks eaglemobiles for doing the hard work.

The code
Code:

<TD style= "border-right: 1px solid #9C9EAA; border-bottom: 1px solid #9C9EAA;" height="23" class="DialogTitle" background="{$ImagesDir}/dialog_bg_n.gif" valign="middle">{$title}</TD>
makes the title bar come out double.

Plus the style should go in the skin1.css file.

For those who want to enclose the bottom with a continuous line. Use a spacer.gif of the same color, like balinor suggested, and aligned it to the bottom at 100% width.

Here is the complete code for dialog.tpl.

Code:

{* $Id: dialog.tpl,v 1.19 2004/06/24 09:53:29 max Exp $ *}
{if $printable ne ''}
{include file="dialog_printable.tpl"}
{else}
<TABLE border="0" cellpadding="0" cellspacing="0" {$extra}>
<TR>
<TD height="15"  class="DialogTitle" background="{$ImagesDir}/dialog_bg_n.gif" valign="bottom">{$title}</TD>
</TR>
<TR><TD class="DialogBorder"><TABLE border="0" cellpadding="10" cellspacing="0" width="100%">
<TR><TD class="DialogBox">{$content}

</TD></TR>
</TABLE><tr>
<td colspan="2">
<table width="100%" cellspacing="0" cellpadding="0" bgcolor="white">
<tr>
<td width="9">
<div align="left">

[img]{$ImagesDir}/smalldialogcnr_left.gif[/img]</div>
</td>
<td width="100%" valign="bottom">

[img]{$ImagesDir}/greyspacer.gif[/img]</td>
<td width="9">
<div align="right">

[img]{$ImagesDir}/smalldialogcnr_right.gif[/img]</div>
</td>
</tr>
</table>
</td>
</tr>
</td><TD></TR>
</TABLE>
{/if}


Next open up skin1.css file.and find .DialogBorder
And add this or whatever color and size you need
Code:

border-right: 1px solid #9C9EAA; border-left: 1px solid #9C9EAA;

Happy Coding

PhilJ 08-10-2006 09:08 AM

[spam] Just added a free rounded corners mod to my site if anyone's interested.

edit: Sorry I removed it a while ago, as some people had problems with it.

fogelka 01-14-2007 11:59 PM

Re: Rounded Corners - Almost there but not quite
 
Interested, but can't find it!

Warwick 08-11-2007 11:18 AM

Re: Rounded Corners - Almost there but not quite
 
Quote:

Originally Posted by PhilJ
[spam] Just added a free rounded corners mod to my site if anyone's interested.

edit: Sorry I removed it a while ago, as some people had problems with it.


Care to share it nevertheless?

PhilJ 08-11-2007 12:02 PM

Re: Rounded Corners - Almost there but not quite
 
http://www.xcartmods.co.uk/count/click.php?id=2

Warwick 08-11-2007 04:32 PM

Re: Rounded Corners - Almost there but not quite
 
Thanks mate!

guy gregor 08-11-2007 11:51 PM

Re: Rounded Corners - Almost there but not quite
 
I was reading around http://www.cssplay.co.uk/boxes/snazzy2.html and in a moment of experimentation did the following...

i added this to the bottom of my css file

.xsnazzy h1, .zsnazzy h1 {
margin:0;
font-size:1.2em;
padding:0 10px 5px 10px;
border-bottom:1px solid #444;
}
.xsnazzy p, .zsnazzy p {
margin:0;
padding:5px 10px;
font-size:10px;
}
.xsnazzy {
background: transparent;
width:153px;
float:left;
margin:0 3px;
}

.xtop, .xbottom {
display:block;
background:transparent;
font-size:1px;
}
.xb1, .xb2, .xb3, .xb4 {
display:block;
overflow:hidden;
}
.xb1, .xb2, .xb3 {
height:1px;
}
.xb2, .xb3, .xb4 {
background:#fff;
border-left:1px solid #444;
border-right:1px solid #444;
}
.xb1 {
margin:0 5px;
background:#444;
}
.xb2 {
margin:0 3px;
border-width:0 2px;
}
.xb3 {
margin:0 2px;
}
.xb4 {
height:2px;
margin:0 1px;
}

.xboxcontent {
display:block;
border:0 solid #444;
border-width:0 1px;
height:220; /* was auto */
}
* html .xboxcontent {
height:1px;
}

.color_a { /* menu top */
background:#B64926; /* was c9ba65 */
color:#fff;
}
.color_b {
background:#CC5200; /* was d4d8bd */
color:#fff;
}
.color_c {
background:#FFF0A5;
color:#fff;
}
.color_d {
background:#FFB03B; /* was b2ab9b */
color:#fff;
}

and then changed my menu.tpl to

<table width="155" border="0">
<div class="xsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b>
<div class="xboxcontent">
<h1 class="color_a">{$menu_title}</h1>
<p>{$menu_content}<br></p>
</div>
<b class="xbottom"><b class="xb4"></b><b class="xb3"></b>
<b class="xb2"></b><b class="xb1"></b></b>
</div>
</table>

and bingo, i had a new menu with rounded corners.

encouraged by how easily it happened i changed dialogue.tpl to

<div class="zsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_d"></b><b class="xb3 color_d"></b><b class="xb4 color_d"></b></b>

<div class="xboxcontent">
<h1 class="color_d">{$title}</h1>
<br />
{$content}
&nbsp;
<br />



<br class="clear" />
<p>The end</p>
</div>
<b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b></b>
</div>

i wont pretent to understand all of it , and all credit to stu at css play . he would like it referenced if you use it , or a donation !

an interesting side effect is its seems very fast. the contents seem to continue to inherit styles from existing css . its pretty much cross browser, but you do need to fiddle with padding a little, and i have used tables here and there to get things to stay still !
you can see the effects on www.sunrisedirect.co.uk , its live , so no ordering please.i am no graphic designer , so there is still a lot of that to do.

From an SEO perspective, googles text cache shows it reading straight down the page , quite neat really.
anyway , i thought i'd share it.

Warwick 08-12-2007 03:27 AM

Re: Rounded Corners - Almost there but not quite
 
guy gregor: this alteration is based on PhilJ's mod right?

guy gregor 08-12-2007 07:05 AM

Re: Rounded Corners - Almost there but not quite
 
no , i just copied code from cssplay.co.uk ,with stu's permission i just posted it as a share really.

eaglemobiles 09-02-2007 07:46 PM

Re: Rounded Corners - Almost there but not quite
 
please any one can help me, i am trying to make round corner for my products list page but it doesnt work for me please check here. http://www.eaglemobiles.co.uk/warehouse/home.php

here is my products_t.tpl.


{* $Id: products_t.tpl,v 1.30.2.4 2006/11/27 11:40:25 max Exp $ *}
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<TD>

<TABLE border="0" cellpadding="1" cellspacing="1" width="100%">

{math equation="floor(100/x)" x=$config.Appearance.products_per_row assign="width"}

{section name=product loop=$products}
{assign var="discount" value=0}

{if %product.index% is div by $config.Appearance.products_per_row}
<tr>
<TD class="menutop" class="VertMenuBorder" align="left" valign="top" bgcolor="#FFFFFF" onMouseOver="this.bgColor='#D4F0FE'" onMouseOut="this.bgColor='#FFFFFF'">&nbsp;</td>
</tr>
<tr>
{assign var="cell_counter" value=0}
{/if}

{math equation="x+1" x=$cell_counter assign="cell_counter" }

<TD class="VertMenuBorder" width="10%" align="left" valign="top" bgcolor="#FFFFFF" onMouseOver="this.bgColor='#D4F0FE'" onMouseOut="this.bgColor='#FFFFFF'">

<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}" class="ProductTitle">{$products[product].product}</a><br />
<table cellpadding="3" cellspacing="0" width="100%">
<tr>
<td width="12%" rowspan="2" valign="top">
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}">
{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].tmbn_x|default:$config.Appearance.thumbnail_width image_y=$products[product].tmbn_y product=$products[product].product tmbn_url=$products[product].tmbn_url}</a>
{if $active_modules.Special_Offers ne "" and $products[product].have_offers}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{/if}
<br />
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}">{$lng.lbl_see_details}</a>
</td>
<td width="87%" valign="top">{$products[product].descr|truncate:100:"...":true} </td>
</tr>
<tr>
<td height="45" align="right" valign="top"><div align="center"><a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_p age}<div align="right"><img src="{$ImagesDir}/trade_account.gif" alt="Trade Sales" width="20" height="20" border="0" /><br />
{$lng.lbl_trade_sale}</a></div></td>
</tr>
</table>
{if $config.Appearance.display_productcode_in_list eq "Y" and $products[product].productcode ne ""}
<b>{$lng.lbl_quick_find}:</b> {$products[product].productcode}
<br>
{/if}

{if $products[product].product_type ne "C"}
<br />
{if $active_modules.Subscriptions ne "" and $products[product].catalogprice}
{include file="modules/Subscriptions/subscription_info_inlist.tpl"}
{else}
{if $config.General.unlimited_products ne "Y" && ($products[product].avail le 0 or $products[product].avail lt $products[product].min_amount) && $products[product].variantid}
&nbsp;
{elseif $products[product].taxed_price ne 0}
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}
{/if}
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</font><br /><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if}
{if $products[product].taxes}<br />{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
{include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]}
{/if}
{else}
<font class="ProductPrice">{$lng.lbl_enter_your_price}</font>
{/if}
{/if}
{if $active_modules.Feature_Comparison ne '' && $products[product].fclassid > 0}
<div align="center" style="width: 100%; padding-top: 10px;">
{include file="modules/Feature_Comparison/compare_checkbox.tpl" id=$products[product].productid}</div>
{/if}
{*** Uncomment it if you need 'Buy Now' button ***}
{if $usertype eq "C" and $config.Appearance.buynow_button_enabled eq "Y"}
{include file="customer/main/buy_now.tpl" product=$products[product]}
{/if}
{*** Uncomment it if you need 'Buy Now' button ***}
{/if}</td>
{capture name=prod_index}
{math equation="index+x+1" index=%product.index% x=$config.Appearance.products_per_row}
{/capture}
{if $smarty.capture.prod_index is div by $config.Appearance.products_per_row }</tr>
{/if}

{/section}

{if $cell_counter lt $config.Appearance.products_per_row}
{section name=rest_cells loop=$config.Appearance.products_per_row start=$cell_counter}
<tr><td align="left" class="SectionBox">&nbsp;</td>
{/section}</tr>
{/if}
</table>
</td>
</tr>
</table>
{if $active_modules.Feature_Comparison ne '' && $products && $printable ne 'Y' && $products_has_fclasses}
{include file="modules/Feature_Comparison/compare_selected_button.tpl"}
{/if}


T H A N K S


All times are GMT -8. The time now is 09:45 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.