Making The Entire Cell "Clickable"
The default settings for Agora Forum requires a user to click on the text of the forum/topic name to enter that forum/topic. This isn't necessarily the most user friendly method of accessing your forums. One way around this is to make the entire row cell click-able and then a user just needs to click anywhere on the cell. You can see an example of this at the Prosupplements Forum.
So, what one needs to do is make the cell a click-able object and the easiest way to accomplish this is to add an "onClick" event to the table cell.
To start, we need to open up forum_row.tpl, which can be found in: /components/com_agora/template/include
Open this file and find the line that looks like this:
td class="ag_column" colspan="2"
Basically, what you are looking for is the first column of the forum table which will have a style called "ag_column". To make this one particular cell "clickable", you need to change the above line to:
td class="ag_column" colspan="2" onClick="document.location.href='{url task=forum id=$forum.id}';" style="cursor:pointer;"
What this accomplishes is adding an "onClick" event handler to the cell that, when clicked, redirects to the particular forum id that the cell was created for in the first place. By adding the cursor:pointer at the end, you add a bit of usability to how the cell is displayed when hovered over.
Now, once you have accomplished this with the forum_row.tpl, you'll need to do the same thing by opening up topic_row.tpl to handle the alternate view for your forum. Again, look for the column with the style "ag_column" and change it to look like this:
onClick="document.location.href='{url task=topic id=$topic.id}';" style="cursor:pointer;">
Notice that the url has changed to reflect the fact that you now need to link to the topic id that he cell was originally created for.
After completed those two straightforward changes, you will see that the entire cell is "clickable" and not just the text within the cell.
Of course, you can carry this on to make the entire row clickable by applying the same idea to each column, adjusting the links as necessary.
Comments
Post a Comment