PDA

View Full Version : Valid XHTML for Geek Products?


KTBleeding
08-25-2005, 11:41 PM
Hey, I'm just curious where you stand on this.
I hate to be the annoying guy who asks, but I've become pretty picky with this to be honest. ;)

I know, and agree that the main priority will be getting it released. But I'd be willing to help make the templates valid XHTML if needed.

Who knows, you may already have this implemented.. I'm at work, so I haven't been able to check out out further than the W3 validator (which could be reporting errors from this vB style).

The Geek
08-25-2005, 11:42 PM
Hey - Im no HTML guy... If you can point out tags that are pissing off the validators - I am more than chuffed to sirt em! ;)

KTBleeding
08-26-2005, 01:40 AM
Cool. :)

I've been taking a jab at it here and I'm stuck on the view cart, which I'm hoping you can help me with:

The problem is with this code,

<input type="text" size="10" id="items[$itemkey]" name="items[$itemkey]" value="$item[qty]" />

In the template gmart_cart_item

Apparently, the [ character is not allowed in the id location (though name and value seem to have no problem with it)

Any ideas? ;)

The Geek
08-26-2005, 08:22 AM
Nope :)

Thats how you pass an array via post.

Image you ordered 1 license and 1 installation of geekmart. Since they are both on the same page, it would get posted as:
$_POST['items'][0]=License - yes
$_POST['items'][1]=Installation - yes
$_POST['items'][0]=Renewal - no!

Are you running the template code through the validator or the final pages? I would think that the template code wont validate for a number of reasons - then again Im no html freak :)

KTBleeding
08-26-2005, 02:03 PM
Well, so far I've only done the view cart section. I just did it by that one page and edited all of the templates that were used. :)

The Geek
08-26-2005, 02:21 PM
youve edited the templates!?!

Let me know what changes were made so I can roll them into the next release.

Thanks!

KTBleeding
08-26-2005, 03:52 PM
Sure thing. I've only done the two for view cart so far, but here they are:

gmart_view_cart

<form action="$vbphrase[gmart_script].php" method="post">
<input type="hidden" name="do" id="do" value="updatecart" />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="4">
<a style="float:$stylevar[right];white-space: nowrap;" href="#top" onclick="return toggle_collapse('gmart_product_items')"><img id="collapseimg_gmart_product_items" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_gmart_product_items].gif" alt="" border="0" /></a>
$vbphrase[gmart_your_cart]
</td>
</tr>
</thead>
<tbody id="collapseobj_gmart_product_items" style="$vbcollapse[collapseobj_gmart_product_items]">
<if condition="$item_bits">
<tr>
<td class="thead" align="left">
$vbphrase[gmart_item]
</td>
<td class="thead" align="right">
$vbphrase[gmart_price]
</td>
<td class="thead" align="center">
$vbphrase[gmart_qty]
</td>
<td class="thead" align="right">
$vbphrase[gmart_ext_price]
</td>
</tr>
$item_bits
</tbody>
</table>

$total_bits
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat">
<a style="float:$stylevar[right];white-space: nowrap;" href="#top" onclick="return toggle_collapse('gmart_cart_options')"><img id="collapseimg_gmart_cart_options" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_gmart_cart_options].gif" alt="" border="0" /></a>
$vbphrase[gmart_your_cart]
</td>
</tr>
</thead>
<tbody id="collapseobj_gmart_cart_options" style="$vbcollapse[collapseobj_gmart_cart_options]">
<tr>
<td class="alt1">
$vbphrase[gmart_cart_instructions]
</td>
</tr>
<tr>
<td class="thead" align="center">
<input type="submit" class="button" name="submit" id="submit" value="Update" />
<input type="submit" class="button" name="checkout" id="checkout" value="Checkout" />
</td>
</tr>
</tbody>
</table>
</form>
<else />
<tr>
<td class="alt1" colspan="4" align="center">
$vbphrase[gmart_cart_empty]
</td>
</tr>
</tbody>
</table>
</form>
</if>
<br />


gmart_cart_item

<tr>
<td class="alt1" align="left">
<a href="$vbphrase[gmart_script].php?$session[sessionurl]do=displayproduct&amp;id=$item[productid]">$item[title]</a>
</td>
<td class="alt1" align="right" width="100px">
$pp[symbol] $item[price]
</td>
<td class="alt2" align="center" width="100px">
<input type="text" size="10" id="items[$itemkey]" name="items[$itemkey]" value="$item[qty]" />
</td>
<td class="alt1" align="right" width="100px">
$pp[symbol] $item[extprice]
</td>
</tr>


That eliminates 11 of the 12 errors that were there. I'll let you know when I figure out the whole [ error. :)

The Geek
08-26-2005, 04:01 PM
thanks man

KTBleeding
08-26-2005, 04:15 PM
No problem.

Actually, Geek.
How important is it that id="items[$itemkey]" is included?
I removed it from the template and it now validates as XHTML.

The cart items also update when putting them in, so it looks like it still functions well.

The Geek
08-26-2005, 04:16 PM
Very important when you have more than 1 item on a page.

KTBleeding
08-26-2005, 05:00 PM
Very important when you have more than 1 item on a page.
Are you sure? I just tested it with three items in my cart and they all update/function just fine.

I think that "name" is substituting it in some way.. even though "name" is supposed to have been depreciated with XHTML. :x

The Geek
08-26-2005, 05:07 PM
maybe im being a lame ass. I havent tested - however maybe PHP automatically makes multiple instances an array. I was pretty sure it had tobe in a php array bracket (ie [] like items[0] for it to come out as $_POST['items'][0]).

KTBleeding
08-26-2005, 05:11 PM
Haha. Well, hey; If you want to give it a whirl of testing, here is the template change:

gmart_cart_item

<tr>
<td class="alt1" align="left">
<a href="$vbphrase[gmart_script].php?$session[sessionurl]do=displayproduct&amp;id=$item[productid]">$item[title]</a>
</td>
<td class="alt1" align="right" width="100px">
$pp[symbol] $item[price]
</td>
<td class="alt2" align="center" width="100px">
<input type="text" size="10" name="items[$itemkey]" value="$item[qty]" />
</td>
<td class="alt1" align="right" width="100px">
$pp[symbol] $item[extprice]
</td>
</tr>

The Geek
08-26-2005, 05:17 PM
but I thought you said it was having problems with:

name="items[$itemkey]"

KTBleeding
08-26-2005, 05:27 PM
Nope. It was having issues with id="items[$itemkey]". Name works fine. Too weird.

KTBleeding
08-27-2005, 02:30 AM
Just to update you guys, I believe I have Geekmart all done in XHTML now. Atleast all the pages I could browse to are valid XHTML that is. ;)

The Geek
08-27-2005, 08:16 AM
Excellent - i want those template changes!