Skip to main content

Developer Note: Customizing Agora Forum - Turning a cell into a link


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

Popular posts from this blog

How To Run Chrome From Within Notepad++

If you have recently tried to Run  Chrome from within Notepad++ recently, you've probably encountered the same issue I did.  Chrome didn't run. The fix is actually really simple.  Open up the Run box in Notepad++ and browse to your installation of Chrome. ie.  C:\Program Files\Google\Chrome\Application\Chrome.exe Select the file when you find it.  Now, the trick is: Put quotation marks around the path you see in the Run  box.  Now, put 1 space after the closing quotation mark. Type this: $(FULL_CURRENT_PATH) It'll look something like this: Click Run .  If Chrome opens, click Save and set your hotkey.

Developer Note: Virtuemart - Editing the Add to Cart MooTool Popup

To edit the “Add To Cart” popup that appears when you add an item to a cart in Virtuemart, there are few files that you need to know about. These are the files to know \components\com_virtuemart\themes\default\theme.js \components\com_virtuemart\js\mootools\   - contains the files for editing the appearance of the popup. To edit the appearance of the box, edit \components\com_virtuemart\js\mootools\mooPrompt.css to change the styles as well as editing the 2 images in the directory to edit how they appear as well (close box and header-background)

Divi Theme - Remove pause 'on hover' of the full width slider

In the Divi theme, open up /js/custom.js Comment out the following code (around line 144) if ( settings.slideshow && et_slides_number > 1 ) { $et_slider.hover( function() { $et_slider.addClass( 'et_slider_hovered' ); if ( typeof et_slider_timer != 'undefined' ) { clearInterval( et_slider_timer ); } }, function() { $et_slider.removeClass( 'et_slider_hovered' ); et_slider_auto_rotate(); } ); }