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

Product Title - How to make it italic?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-03-2007, 09:34 AM
 
BobTastic BobTastic is offline
 

Advanced Member
  
Join Date: Oct 2006
Location: London, England
Posts: 55
 

Default Product Title - How to make it italic?

Hi,

I am doing a site for a friend of mine who sells wild roses. Many of the products have latin names such as 'Rosa gallica Complicata'.

Is it possible to have product titles formatted like this? Because it's not all in italics, just some of it.

Thanks,

Tim
__________________
Version: 4.4
OS: Linux
Reply With Quote
  #2  
Old 05-09-2007, 04:34 AM
 
BobTastic BobTastic is offline
 

Advanced Member
  
Join Date: Oct 2006
Location: London, England
Posts: 55
 

Default Re: Product Title - How to make it italic?

Anyone?
__________________
Version: 4.4
OS: Linux
Reply With Quote
  #3  
Old 05-09-2007, 05:24 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Product Title - How to make it italic?

Because you need to format the product title in 2 parts, you'll probably need to make an extra field for the non-italic part (or vice versa).

You'll need to wrap your head around extra fields and how they integrate with product.tpl

It can be done. Good luck.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #4  
Old 05-09-2007, 02:48 PM
 
BobTastic BobTastic is offline
 

Advanced Member
  
Join Date: Oct 2006
Location: London, England
Posts: 55
 

Default Re: Product Title - How to make it italic?

Thanks for replying. I'm glad to hear it can be done, but it seems beyond my skills. Perhaps I'll have to get this one outsourced, or not bother using italics.

Thanks again.
__________________
Version: 4.4
OS: Linux
Reply With Quote
  #5  
Old 05-09-2007, 05:01 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Product Title - How to make it italic?

at first i thought you could use html tags for the title, but apparently not

but i found a simple way around this and that is to manipulate strings using smarty

in product.tpl look for
Code:
{include file="dialog.tpl" title=$product.producttitle content=$smarty.capture.dialog extra='width="100%"' productpage}
and replace with
Code:
{include file="dialog.tpl" title=$product.producttitle|replace:"#i#":"<i>"|replace:"#/i#":"</i>" content=$smarty.capture.dialog extra='width="100%"' productpage}



in products.tpl or products_t.tpl, depending if you use the default column setup or not, look for
Code:
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_page}{if $featured eq 'Y'}&amp;featured{/if}"><font class="ProductTitle">{$products[product].product}</font></a>
and replace with
Code:
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_page}{if $featured eq 'Y'}&amp;featured{/if}"><font class="ProductTitle">{$products[product].product|replace:"#i#":"<i>"|replace:"#/i#":"</i>"}</font></a>



and in the admin section when adding products, for the title name put #i# and #/i# as the open and closing of the italicized tags
(similar to <i> and </i>)

so in your example you type in: #i#Rosa gallica#/i# Complicata

the admin section will still show the #i# and #/i# however, which you can always mod as well using the replace as above


you have to edit bread crumbs and html title, but have it replace it with a null string rather than the italics for this case, as well (and whatever else that uses product title), but i cant think off the top of my head which tpl's these correspond to
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #6  
Old 05-09-2007, 05:19 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Product Title - How to make it italic?

Quote:
so in your example you type in: #i#Rosa gallica#/i# Complicata
Wow. Smarty is so f-ing cool. I would have used the space shuttle to cross the street.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #7  
Old 05-09-2007, 06:49 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default Re: Product Title - How to make it italic?

An easier way would be to use this:

product.tpl
Code:
{include file="dialog.tpl" title="<em>`$product.producttitle`</em>" content=$smarty.capture.dialog extra='width="100%"'}

products.tpl
Code:
<a href="product.php?productid={$products[product].productid}&amp;cat={$cat}&amp;page={$navigation_page}{if $featured eq 'Y'}&amp;featured{/if}"><font class="ProductTitle"><em>{$products[product].product}</em></font></a>

Or even better (for the products.tpl file), just change the ProductTitle class in skin1.css to this:

Code:
.ProductTitle { COLOR: #000000; FONT-WEIGHT: bold; FONT-SIZE: 12px; font-style: italic; }
Reply With Quote
  #8  
Old 05-09-2007, 08:40 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Product Title - How to make it italic?

that would italicize the whole title, he only wanted some of it to be italicized
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #9  
Old 05-09-2007, 08:47 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default Re: Product Title - How to make it italic?

Quote:
Originally Posted by inebriate
that would italicize the whole title, he only wanted some of it to be italicized

...I guess maybe I should have read the orignal post...
Reply With Quote
  #10  
Old 05-13-2007, 09:06 PM
 
Asiaplay Asiaplay is offline
 

X-Wizard
  
Join Date: Oct 2005
Posts: 1,242
 

Default Re: Product Title - How to make it italic?

Hi All,

Another way of doing... just incase anyone prefers this approach (but the fix mentioned above will work too).

I do Italics a different method than is used above.... for Italics I just use '<em>' to open and '</em>' to close.
Using this there is no need to change the code within X-Cart at all (essentially the <em> script for php & smarty, is the same thing as using <i> in html)

So for example 'Rosa gallica Complicata' would be '<em>Rosa gallica</em> Complicata'

NOTE: This only Works if you do either a CSV import for the Product description OR you do the editing directly to your SQL table inside something like PHP MyAdmin (it does not work if you try to enter this into the field in X-Cart Admin product description field... this is as X-Cart parses / pass via a script on Save and doing this they remove the <em> etc.).

However, If you want to type directly into X-Cart Admin, there is another way.
i.e. '<span style="font-style: italic;">Rosa gallica</span>Complicata'

But as you can see, you need to type much more text (but still no need to change the code in the tables for this to work)... however, if you use X-Cart Admin to enter the product descriptions, the fix above is perhaps an easier way (as code used to create italics within the product description is shorter).

Personally I think the upload / import via CSV (and using <em>xxx</em>) is another feasible alternative, if you need to mix normal fonts with italic fonts.

Hope comments are useful - cheers, Asiaplay.
__________________
X-Cart Gold version 4.1.9
(plus built in X-Cart bugs!)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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 11:03 AM.

   

 
X-Cart forums © 2001-2020