Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 02:00:58 PM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155539 Posts in 21712 Topics by 7737 Members
Latest Member: deanmacullam
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: neat hack for event calendar module  (Read 299 times)
dellington

Offline Offline

Posts: 86


« on: August 05, 2010, 04:25:27 PM »

I am excited to finally have my own contribution to this great product.

What I needed was for the titles of events to always be displayed in a column on the homepage, with a link from each title going to a full description on the actual Events webpage. See it in action here:

http://www.handsonwnc.org/

I modified view.php of the events module to make this work. Essentially I am displaying the events page within that column (I call it by its section ID in my site template). I am using a class to "hide" the description unless the body id tag equals "events". (Are most people using a unique body ID for each page? It's so easy to do, and makes some CSS tricks way easier...there's a thread somewhere on it or I can post the code below.)

I also included an anchor tag, setting the anchor value to event_id (which should always be unique) so that when a user clicks the link, they go directly to the right area on the Events page.

So I want to ask if I should post the view.php file in case others want to see how I did it, or if this could be incorporated as an option in the module, or what.

I also suspect that calling the events page by section ID in the template isn't the most graceful way to always include that section...is there a better way?
Logged
dellington

Offline Offline

Posts: 86


« Reply #1 on: August 05, 2010, 04:30:46 PM »

This is the cool trick for making your body id equal to your page name:

Code:
<body id="<?php echo str_replace(" ","-", (strtolower(MENU_TITLE))); ?>">

From this thread: http://www.websitebaker2.org/forum/index.php/topic,2985.msg18874.html#msg18874
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!