![]() |
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 |
Re: Product Title - How to make it italic?
Anyone?
|
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. |
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. |
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} 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}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}"><font class="ProductTitle">{$products[product].product}</font></a> Code:
<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&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 |
Re: Product Title - How to make it italic?
Quote:
|
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}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&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 { |
Re: Product Title - How to make it italic?
that would italicize the whole title, he only wanted some of it to be italicized
|
Re: Product Title - How to make it italic?
Quote:
...I guess maybe I should have read the orignal post... :oops: |
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. |
Re: Product Title - How to make it italic?
Thanks for the replies everyone. I really appreciate it. I have only just read through them. I will have a go at your suggestions this week.
Thanks, Bob |
Re: Product Title - How to make it italic?
In the XCart 4.1.x branch you can also add the "product" field to the $trusted_post_variables array in the following files to stop tags from being stripped from the product title. You simply need to modify the following files:
/xcart/provider/product_modify.php /xcart/admin/product_modify.php Near the top of each of those files is a line that looks like: PHP Code:
PHP Code:
|
All times are GMT -8. The time now is 03:49 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.