Get in touch with us now or provide us your contact number and our representative will call you back.
Category drop-down for TYPO3 "cal" extension
By: Pankaj Lele
Today I came across a TYPO3 requirement from one of our customers that they need a simple list of events and single view of each event. Additionally they wanted to have a drop-down box showing all event categories and the event list should be filtered with the selected category on change of the drop-down.
I was knowing that the "cal" extension is good extension to work with events in TYPO3. "cal" has list and single event view out of the box but there was no marker available for the list view for category selection. I googled to seek a solution but nothing was found quickly. So I decided to write a quick TypoScript object which simply queries the category table and makes a <select> construct. It took 10 minutes for me to develop the TS and I have it running now. So I thought to share this with everybody.
The following TS object can be put on any page with plugin "tscobj" and it will show you the drop-down with the cal categories. Only thing you have to change is the pid of the event listing page and pid of the events sysfolder.
# object to render cal categories as a dropdown
lib.eventcategories = COA
lib.eventcategories {
# the all/alle option
10 = TEXT
10 {
# pid of the event list page
typolink.parameter = 131
typolink.returnLast = url
wrap = <option value="|">Alle</option>
}
# render all categories as <option></option>
20 = CONTENT
20 {
table = tx_cal_category
# pid of the event storage sysfolder
select.pidInList = 132
renderObj = COA
renderObj {
# this object is rendered only if the tx_cal_controller[category] does not equal
# to category uid in record set
10 = TEXT
10 {
# pid of the event list page
typolink.parameter = 131
typolink.additionalParams.dataWrap = &tx_cal_controller[category]={field:uid}
typolink.useCacheHash = 1
typolink.returnLast = url
dataWrap = <option value="|">{field:title}</option>
if.value.data = GPvar:tx_cal_controller|category
if.equals.field = uid
if.negate = 1
}
# this object is rendered only if the tx_cal_controller[category] equal to
# category uid in record set. so it makes the option selected!
20 < .10
20 {
dataWrap = <option value="|" selected="selected">{field:title}</option>
if.negate >
}
}
}
# wrapping all options in a select and JS to make redirect onChange!
wrap = <select onChange="javascript: window.location=this.options[this.selectedIndex].value;">|</select>
}
# this condition hides the category dropdown on single event page!
[globalString = GP:tx_cal_controller|view = event]
lib.eventcategories >
[global]
TYPO3 News
| TYPO3 news: All news | ||
| news.typo3.org: The TYPO3 news resource | ||
| Heads first into a new year - January 2012 | ||
| 3/02 - 2012 | karsten@typo3.org | Development |
| After an exciting 2011 we have meanwhile completed the first month of 2012. Just like probably everyone else we have some ideas for doing things better than in the past, and this includes... | ||
| Restructuring the TYPO3 Association | ||
| 2/02 - 2012 | TYPO3 Association | |
| The organizational structure of the TYPO3 Association isn't a proper fit anymore to the TYPO3 project's own internal structure, nor does it fit the size the project has become over time. A need... | ||
CMS News
| Real Story Group Recent Blog Entries < Real Story Group | ||
| www.realstorygroup.com : Blogs | ||
| Akamai, Limelight, or EdgeCast? Considerations when Selecting CDNs and OVPs #DAM #MediaAssetManagement | ||
| 7/02 - 2012 | ||
This week we publish an Advisory Paper for our Digital & Media Asset Management research subscribers about key | ||
| Alfresco Version 4 is Buzzword Compliant #Cloud #mobile | ||
| 7/02 - 2012 | ||
Last week open source document management vendor Alfresco | ||
| WebSphere Portal, Coremedia or EMC Documentum? #ecm #portals | ||
| 6/02 - 2012 | ||
I enjoyed an excellent day in Oxford last week speaking (and listening to the other speakers) at a CMS Expert Group round table event. Many topics of interest emerged, but the one that underlay... |
||
| What the IBM Worklight Acquisition Means for WebSphere Customers #mobile #ibm | ||
| 6/02 - 2012 | ||
Last week, IBM acquired erstwhile partner Worklight, an Israel-based vendor. Worklight is a platform for... |
||
| Sharpening the dull Digital Asset Management functionality in SharePoint #DAM #sharepoint | ||
| 2/02 - 2012 | ||
It is an understatement to say that SharePoint has become a nearly ubiquitous platform for workplace collaboration. Yet, as our technology evaluation subscribers know, SharePoint may be omnipresent... |
||