The vB Geek

The vB Geek (http://www.thevbgeek.com/index.php)
-   Lizard Lounge (http://www.thevbgeek.com/forumdisplay.php?f=39)
-   -   Valid XHTML for Geek Products? (http://www.thevbgeek.com/showthread.php?t=60)

KTBleeding 08-25-2005 10:41 PM

Valid XHTML for Geek Products?
 
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 10: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 12: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,
HTML 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 07: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 01: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 01: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 02:52 PM

Sure thing. I've only done the two for view cart so far, but here they are:

gmart_view_cart
HTML Code:

<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
HTML Code:

<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 03:01 PM

thanks man

KTBleeding 08-26-2005 03: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 03:16 PM

Very important when you have more than 1 item on a page.


All times are GMT. The time now is 04:48 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.