Page 1 of 1

Reviews

Posted: Fri May 26, 2006 6:12 pm
by HMTKSteve
I'm trying to put together a website for a game reviewer. I've got most of the basics already covered but he wants the main review page to be able to list all the current reviews and be sortable by the user in varying orders (date written, subject, written by, etc...)

Is this something I can accomplish using tags to generate this type of page?

I'd rather not update this ToC page everytime a new review is added to the system...

current menu system is
-Reviews
--#
--A
--- review of aeroplanes
--- review of apples
--- etc...
--B
-- etc... (first letter of subject)
--z

the top and second level menu items are set as seperators (so they don't go anywhere) but it sounds like he wants each of these seprators to be pages on their own and list every item below them as a link (with some description text)

-Reviews
would list all reviews and be sortable by different columns

--# (through Z) would list all reviews starting with that letter and also be sortable as above

I like the idea of the reviews being on the third level of the menu but he wants the lists (he's coming from a hand coded HTML background)

So, is there any easy way to search the database and create these pages using PHP/SQL i.e. use the parentID of each page as a sort parameter? Would it break down on the "Review" top level menu because the reviews are children of the "Review" menu item's children?

Re: Reviews

Posted: Sat May 27, 2006 2:26 pm
by Dr.CSS
have you thought of putting the reviews in News and having it on the side?
it's pretty flexible on displaying articles....

  mark

Re: Reviews

Posted: Sat May 27, 2006 7:16 pm
by HMTKSteve
After looking at the available modules I decided to use the Catalog one to implement this.

Now I have a question about the Catalog module...

I'm Placing each review in the "Catalog Item" Type but when I try to edit the template for the "Catelog Category" entry I'm running into some trouble.

I want to have several columns of data on the category page but I can't get it to pull the data from the items.

Code: Select all

{assign var="cols" value="1"}

<table style="border: solid 1px black;">
<tr>

<td>Title</td>
<td>Date Review Published</td>
<td>Publisher</td>
<td>Designer</td>
<td>Year Game Published</td>
<td>Rating</td>
</tr>
<tr>    {section name=numloop loop=$items}        
 
<td> <a href="{$items[numloop].link}">{$items[numloop].title}</a> </td>
<td> {$items[numloop].datereviewpublished} </td>
<td> {$items[numloop].publisher} </td>
<td> {$items[numloop].designer} </td>
<td> {$items[numloop].yeargamepublished} </td>
<td> {$items[numloop].rating} </td>

        {if not ($smarty.section.numloop.rownum mod $cols)}
                {if not $smarty.section.numloop.last}
</tr>
<tr>
                {/if}
        {/if}
        {if $smarty.section.numloop.last}
                {math equation = "n - a % n" n=$cols a=$items|@count assign="cells"}
                {if $cells ne $cols}
                {section name=pad loop=$cells}
                        <td style="width: 200px;"> </td>
                {/section}
                {/if}
</tr>
        {/if}
    {/section}
    {if $hasnav == 1}<tr><td{if $cols gt 1} colspan="{$cols}"{/if} style="border-top: solid 1px black;">{$prev}{$navstr}{$next}</td>
</tr>
	{/if}</table>
Above is the code I hacked up for my category page but it is not frawing the variables from the item.

My Item template looks like:

Code: Select all

<div class="item"><p>{$title}</p><table>

<table style="border: solid 1px black;">
<tr>

<td>Date Review Published</td>
<td>Publisher</td>
<td>Designer</td>
<td>Year Game Published</td>
<td>Rating</td>
</tr>
<tr>         
 
<td> {$datereviewpublished} </td>
<td> {$publisher} </td>
<td> {$designer} </td>
<td> {$yeargamepublished} </td>
<td> {$rating} </td>


</tr>


<tr>  </tr></table>{section name=at loop=$attrlist}<p><strong>{$attrlist[at].name}</strong>: {eval var=$attrlist[at].key}</p>{/section}{literal}<__script__ type="text/javascript">function repl(img)   {   document.item_image.src=img;   }</__script>{/literal}</div>
and the above works fine for testing purposes. (I'll pull the ending repeating code when we go live.)

the site is temporarily hosted at: my website

Can anyone help me out?

Re: Reviews

Posted: Sun May 28, 2006 9:32 pm
by sjg
Sorry. It was a bug.

It should work magnificently (or at least work) in version 0.4.2, released today.

___Samuel___