University Web Developers

University Web Developers

I was recently upgraded to the Enterprise Edition and was excited to begin using the widgets I had heard so much about, e.g., news pulls, photo galleries, etc. EXCEPT, there are zero pre-built widgets to dissect and figure out how to build a new one. Cue Game show loser sound effect... "WAAAH wahhh waaaaahhhh"

I get that they begin with structures, but what I don't get is how to make the variables as part of the structure and how, in the end, those would get pulled into the widget.

Here's what I'm thinking would be the end result. User wants to make a photo gallery. Adds "Widget-Photo Gallery" to their container. A pop-up window asks them to browse for a folder and voila! Photo Gallery.

If you choose to reply, Fienen and/or Falzone, type slowly so I can understand. :)

Tags: widget

Share

Reply to This

Replies to This Discussion

I am working on this exact same puzzle right now. So the answer has and audience of at least two. :)

Reply to This

I love how you call out Chris and me specifically on this, heh.

Widgets are crazy easy. I actually just finished up on one for departments to use to pull in custom listing of news from PR based on categories. It took less than an hour to set up.

If you are familiar with writing dynamic Velocity code, you pretty much won't have an issue. Let's use your case of a photo gallery (and we'll assume you're gonna use the built in gallery macro).

Create a structure with a type of widget, and call it something like "Photo Gallery." Add a text field called "Gallery Path." That's where they can put in the folder name with their pictures. Now, edit the Widget Code field, and you'll do something like this:

<h2>$widgetTitle</h2>
#photoGallery("$galleryPath")

Bam, you're done, instant widget. Now, you could start taking it further, like add fields for photo height and photo width, then set them in the widget code. That's what I usually do. When I use a widget to serve as a UI for a macro, I'll add a section at the bottom with all the optional elements you can set, and in the widget code, I see if those have been entered, and if so, add a #set() line for that macro variable.

There's also some info in the docs about how to set it up that'd probably be helpful: http://www.dotcms.org/documentation/widgets If you want some real time help, come by the IRC channel (http://www.dotcms.org/community/irc.dot) or catch me on IM or Twitter.

Reply to This

Hah, there's my name. Michael's answer is great so I won't go much farther than saying that there should be some simple examples like this in starter site. I thought there were some, but if not, then hopefully the DotCMS guys are listening and they'll put some in. You could also stop by their JIRA and put in a request: http://jira.dotmarketing.net

Reply to This

I think I've pretty much got it.

1. Create Structure - Make sure it is a widget structure type.
2. Add Custom Field
3. Learn Velocity
4. Insert Velocity and lucene query into Widget Code field
5. Have users add widget to pages and watch your site blossom.

I'm still a little stuck on #3.

Reply to This

yep. #3 is a doozy.

Reply to This

So yeah, velocity is a strange animal, but as far as programming goes .. it really is not that hard.

The main concepts you need to know are
#set - sets a variable
#if ... #else ... #end - for conditionals
#foreach ... #end - for looping

Macros -- Macros are like a chuck of code that just gets executed. They cannot return a value, but they can #set a variable.

Viewtools -- Java Objects. Velocity is Java under the hood so for the most part .. whatever you can do in Java you can do in velocity.

That is really all there is too it.

1. Check out the user guide: http://velocity.apache.org/engine/devel/user-guide.html
2. TRY it .. you're never going to learn velocity unless you get your hands dirty
3. If you can't figure something out .. join us on the irc channel .. #dotcms on freenode.

Good luck :)

Reply to This

actually... I just did it in about 2 minutes. Easy. The basic bit anyway. Now I realize that I need to create some pretty css to make the gallery not look meh.

Reply to This

RSS

Elsewhere

Latest Activity

Adam Green, David Cantwell, Mollee Sheehan and 2 more joined University Web Developers
10 hours ago
OmniUpdate’s CMS business is booming and we are looking for a strong software developer with Java experience. Help us grow our team.
12 hours ago
Please add me too: naveenatwal @ googlewave.com Thanks.
16 hours ago
Kara Walker added a discussion
Morehouse College invites applications for Multimedia Developer in the Office of Communications. Job Duties: The multimedia developer reports to the Director of Public Relations and works with the web content manager and the web developer. The mu...
16 hours ago
Our Public Affairs department is responsible for the rotating content on our university front page (Cal State Fullerton). Outside of the basic architectural links, news and events are the only things highlighted. Whenever someone wants something, ...
18 hours ago
Thanks! Our senior web designer, Stephen Bell, made it. He's in this ning community somewhere. :)
21 hours ago
We also have Employment Opportunites listed as one of our main links on our home page and on every page. We even have our Employment links broken down into two different areas. One of students "Employment-Students" and one for regular full-time jo...
22 hours ago
Francis Zablocki added a discussion
Hi all, I've just started a project to implement Harris Connect as an alumni portal/crm system and I'm looking for any success/horror stories that may be out there. Of most interest are any strategies that people have used for integration of Harri...
22 hours ago
Employment Opportunities is one of the 12 main navigation links in the header of our Web site template. Therefore, it appears not only on the home page, but on almost every page of our site.
on Friday
Erik Espana, Rick Gould, Gloria Edwards and 1 more joined University Web Developers
on Friday
I just opened my account jfduguid (at) googlewave
on Friday
Off topic, but the hide/show social media icon bar on your site is very well done.
on Friday
Global footer that says "We're Hiring". It is one of our top visited pages.
on Friday
Thanks for the feedback - the backstory here is that our HR office has requested to be on the homepage, but the college's Web Advisory committee has been refusing the request. I thought a link in the global footer would be a nice solution, so I'm ...
on Friday
"Employment at SJC" is a link in our footer that is on every page, including the homepage. We also have a prominent link in the navigation one level down under our "About Us" section. It's one of our top hits also.
on Friday
Share your experiences using OmniUpdate CMS
on Friday
We have an Employment link in the footer of every page, including our home page.
on Friday
OmniUpdate’s CMS business is booming and we are looking for several Web Services Technicians. Help us grow our team.
on Friday
Yes, we list it on the homepage. Our HR person requested this as part of our redesign about a year ago and I thought it made sense.
on Friday
We have a "Jobs" link in our global footer.
on Friday

An adjunct to UWEBD. UWEBD has been in existence for more than 10 years and is the very best email discussion list on the Internet, in any industry, on any topic.

About

© 2009   Created by Mark Greenfield

Badges  |  Report an Issue  |  Privacy  |  Terms of Service

Sign in to chat!