vkaryl
08-20-2005, 03:12 AM
::Preface::
(This is a pretty long post, sorry....)
While implementing phpLD for directories on several sites I became aware that the program, an otherwise fairly standards-compliant script [1] was arbitrarily inserting an empty
tagset in subcategory lists on a regular basis. Pages produced by the script validated; but an empty tagset is certainly not ideal nor standards-compliant, and might cause directories to break validation at some point in the future. This was therefore problematic.
::Current Situation::
I chose to request assistance from the Smarty template support forum (since phpLD is based upon the Smarty Templating Engine).
Following is code submitted on the Smarty forum:
------------------------------------------------------------
Relevant code from main.tpl submitted to Smarty forum (these are the sections which echo category and subcategory lists to screen):
Content visible to registered users only.Source code parsed from above submitted to Smarty forum (derived by viewing source of the index page):
------------------------------------------------------------
Following are quotes from the Smarty forum responses at http://www.phpinsider.com/smarty-forum/viewtopic.php?t=6007....
Post by mohrt, Smarty forum admin:
Content visible to registered users only.mohrt, again:
Content visible to registered users only.boots, Smarty forum administrator replied:
Content visible to registered users only.::Resolution::
This was an issue within the code provided by the phpLD team for the subcategory section display, wherein an empty
tagset was being created in any given list of subcategories. In originally posting regarding this problem, I noted that pages validated even with the empty tagsets, but that I considered it sloppy coding. Casey became defensive, pointing out that had I been using tables instead of tableless layout I wouldn't be having the problem.
mohrt and boots from the Smarty forum keyed immediately upon the offending code in the original template which is contained within both recent RC versions, 4 and 5, in the main.tpl file. You will note that the problem code within the subcat section was code which "came standard" with both RC4 and RC5. This is certainly nothing that I inserted - it was already there. Removing it fixed the empty tagset problem.
"offending code" from the "subcategory" section of:
RC4
Content visible to registered users only.and
RC5
Content visible to registered users only.Once I removed the "offending" section of the code the pages now have no empty tagsets in the subcategory lists. This was certainly not a huge programming fix: it took the folks at the Smarty forum less than 20 minutes to look over the code I provided and explain the problem. If I, a total newbie to Smarty and to phpLD, can remove offending code once I am shown where the problem occurred, surely the programming team at phpLD should have been able to determine where the problem lay and provide the same information instead of saying in essence, "too bad - you aren't using tables, we can't help you since we don't know anything but tables"....
::NB::
(This is a pretty long post, sorry....)
While implementing phpLD for directories on several sites I became aware that the program, an otherwise fairly standards-compliant script [1] was arbitrarily inserting an empty
tagset in subcategory lists on a regular basis. Pages produced by the script validated; but an empty tagset is certainly not ideal nor standards-compliant, and might cause directories to break validation at some point in the future. This was therefore problematic.
::Current Situation::
I chose to request assistance from the Smarty template support forum (since phpLD is based upon the Smarty Templating Engine).
Following is code submitted on the Smarty forum:
------------------------------------------------------------
Relevant code from main.tpl submitted to Smarty forum (these are the sections which echo category and subcategory lists to screen):
Content visible to registered users only.Source code parsed from above submitted to Smarty forum (derived by viewing source of the index page):
------------------------------------------------------------
Following are quotes from the Smarty forum responses at http://www.phpinsider.com/smarty-forum/viewtopic.php?t=6007....
Post by mohrt, Smarty forum admin:
Content visible to registered users only.mohrt, again:
Content visible to registered users only.boots, Smarty forum administrator replied:
Content visible to registered users only.::Resolution::
This was an issue within the code provided by the phpLD team for the subcategory section display, wherein an empty
tagset was being created in any given list of subcategories. In originally posting regarding this problem, I noted that pages validated even with the empty tagsets, but that I considered it sloppy coding. Casey became defensive, pointing out that had I been using tables instead of tableless layout I wouldn't be having the problem.
mohrt and boots from the Smarty forum keyed immediately upon the offending code in the original template which is contained within both recent RC versions, 4 and 5, in the main.tpl file. You will note that the problem code within the subcat section was code which "came standard" with both RC4 and RC5. This is certainly nothing that I inserted - it was already there. Removing it fixed the empty tagset problem.
"offending code" from the "subcategory" section of:
RC4
Content visible to registered users only.and
RC5
Content visible to registered users only.Once I removed the "offending" section of the code the pages now have no empty tagsets in the subcategory lists. This was certainly not a huge programming fix: it took the folks at the Smarty forum less than 20 minutes to look over the code I provided and explain the problem. If I, a total newbie to Smarty and to phpLD, can remove offending code once I am shown where the problem occurred, surely the programming team at phpLD should have been able to determine where the problem lay and provide the same information instead of saying in essence, "too bad - you aren't using tables, we can't help you since we don't know anything but tables"....
::NB::