PDA

View Full Version : ditching font tags


Johnny
03-31-06, 03:53 PM
I'm trying to get rid of all the many repeated <font> commands that litter the html code, and replace them with a global css definition.

Take this bit of code from the product display -

<td align="left" valign="top">
<mvt:item name="fonts" param="body_font">
Quantity in Basket:
<mvt:if expr="l.settings:product:quantity EQ 0">
<i>None</i>
<mvt:else>
<b>&mvt:product:quantity;</b>
</mvt:if>
<br>
Code: <b>&mvt:product:code;</b><br>
Price: <b>&mvt:product:formatted_price;</b><br>
<mvt:if expr="l.settings:product:inv_active">
&mvt:product:inv_long;
</mvt:if>
</mvt:item>
</td>

If I'm reading it correctly I can just delete the two lines below and it will remove the font command and the </font> tag.

<mvt:item name="fonts" param="body_font">
</mvt:item>

Just a couple of questions -

1) Is the body font defined somewhere else (ie. can I just delete it in one place and leave the above lines in to be converted into no code?)
2) If I delete the two lines above are there any other implications? ie. is it simply replaced by the font tags or do the product variables require them?

Thanks,

John.

DesignExtend-MSI
03-31-06, 04:00 PM
If I'm reading it correctly I can just delete the two lines below and it will remove the font command and the </font> tag.

<mvt:item name="fonts" param="body_font">
</mvt:item>


That's correct. That actually wraps the font tags around the content within that table cell.

1) Is the body font defined somewhere else (ie. can I just delete it in one place and leave the above lines in to be converted into no code?)
It calls it from your store's settings for the fonts, but it won't blank out those lines from the templates. I do recommend blanking them out in the settings though in case you miss some. CSS can override it.

2) If I delete the two lines above are there any other implications? ie. is it simply replaced by the font tags or do the product variables require them?

Just the fonts. Just pay close attention to what you're doing.

:cool:

Johnny
03-31-06, 04:06 PM
It calls it from your store's settings for the fonts, but it won't blank out those lines from the templates.

It won't blank out the lines in the template, but if the global font is all blank will it be smart enough to not put any code in the final html... or will it just put in blank tags, ie. <font>...</font>

Johnny
03-31-06, 04:09 PM
and the answer is... blank tags ... <font></font> - think i will just delete those 2 lines...

DesignExtend-MSI
03-31-06, 04:10 PM
and the answer is... blank tags ... <font></font> - think i will just delete those 2 lines...

Yep - you're trying it out was quicker than I could answer it.

Johnny
03-31-06, 04:21 PM
crikey, this is harder than it looks...


<mvt:item name="fonts" param="body_font">
Quantity:
<input type="text" name="Quantity" value=1 size=4>
</td></tr>
<tr><td align="left" valign="middle">
<mvt:item name="buttons" param="AddToBasket" />
</mvt:item>


this body_font doesn't appear to have an end tag - unless it's the next end tag down, but that looks like the end tag for the button tag - assuming the button tag needs an end tag (I assume anything that starts <mvt:item...> requires and end tag?) - and that makes sense as they're in different cells - In which case where did the font end tag go???

Johnny
03-31-06, 04:22 PM
Ah, here's another one with no end tag... maybe only certain ones have end tags...? or is my code just total pants?

<tr><td align="left" valign="top">
<mvt:item name="product_attributes" param="product:id" />
</td></tr>

DesignExtend-MSI
03-31-06, 04:23 PM
Did you do a view source on the front end to see if it's actually closed? That will usually tell you.

Vic - WolfPaw Computers
03-31-06, 04:29 PM
Johnny,

Are you referring to this line?

<mvt:item name="product_attributes" param="product:id" />

As not having a closing tag?

In HTML 4, the trailing / is an implied closing tag. Its become quite the norm in coding these days. Saves keystrokes and file sizes a few characters at a time.


Ah, here's another one with no end tag... maybe only certain ones have end tags...? or is my code just total pants?

Johnny
03-31-06, 06:05 PM
ah, that explains it!