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

Views: 34

Replies to This Discussion

I am working on this exact same puzzle right now. So the answer has and audience of at least two. :)
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.
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
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.
yep. #3 is a doozy.
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 :)
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.

RSS

Elsewhere

Latest Activity

Jason Slater posted a discussion

Video aggregator/portal solutions?

Anyone know of any solutions to aggregate videos from a variety of youtube and vimeo sources?  We've tried Miro Community but are looking for something similar.See More
yesterday
Christina Anderson is now a member of University Web Developers
Thursday
Cary Foster posted a discussion

UI/UX Designer Wanted, Oberlin College

Oberlin College has an extraordinary opportunity for a fun-loving designer to join the supercharged webteam.  Please share with anyone who might be interested!UI/UX Designer Wanted:http://new.oberlin.edu/home/jobs/jobs_detail.dot?id=5405961See More
Wednesday
Profile IconBilly McDonald and Meg Thomas joined University Web Developers
Monday
Daniel Bashaw replied to Kimbel Jeffers's discussion Office Reservation software
"Hi Kimbel -- Does you manual process include a checklist and workflow documentation? If not, it sounds to me like checklists and schedulers are your best next steps. You can structure and document what you do now, and then look at it to see if there…"
May 17
Kimbel Jeffers replied to Kimbel Jeffers's discussion Office Reservation software
"The problem is we use a manual process right now and things keep falling through the cracks."
May 16
Annette Spearman replied to Derek Tonn's discussion Freelance web design recommendations (small projects)
"Hi Derek, We can help you! I'll in box you all my info so we can connect and set up some time to talk. Annette "
May 16
Mark Rothbaum posted a discussion

5-Minute Survey on Use of Facebook in Admissions

We're conducting our annual survey on Facebook and Admissions. Please take a few minutes to complete the survey at:http://www.varsityoutreach.com/FacebookSurvey/Our GoalOur goal is to explore trends related to how schools are using Facebook to reach out to prospective and admitted students.How Is the Data Used?All data will be shown in the aggregate. Answers from individual schools will not be released and will remain…See More
May 16
Profile IconSang Yoon and Brittany Smith joined University Web Developers
May 15
Colleen Brennan-Barry posted a discussion

HighEdWeb Welcomes Steve Wozniak & Scott Stratten

HighEdWeb is very pleased to announce HighEdWeb 2013 Annual Conference opening keynote speaker Steve Wozniak and closing keynote speaker…See More
May 15
faris ahmed commented on social networking web design's blog post Megastar Media Webby Award Honorees
"wow thats amazing article .  your stuff never fails to amaze me honestly . great work as always :D  something i would like to add in is that  the entries each year are rapidly increasing .  but i think thats cause they take the…"
May 14
Lynn Zawie posted a discussion

Freelance Web Developer Needed

Stony Brook University web team is looking for some help coding a new design.  HTML5, CSS3, JQuery, Responsive Design expertise needed.  If you are interested in bidding on this project, I am happy to share more details.  Work would need to begin early summer.  ..LynnSee More
May 14
Sara Michel commented on Lynn Zawie's group OmniUpdate
"Great blog post by Higher Education Marketing on leveraging Google pay-per-click ad extensions for higher ed."
May 14
Sara Michel commented on Lynn Zawie's group OmniUpdate
"Check out Naropa University's new online magazine. Looks awesome! Great job team."
May 13
Norma J Dowell replied to Derek Tonn's discussion Freelance web design recommendations (small projects)
"Hi Derek! First of all, apologies for taking so long to respond! Secondly, I am not your web developer for such an issue, but if you can find someone to pick their brain and use as a sounding board, it may be all you need.  In the past, when I…"
May 13
Daniel Bashaw replied to Kimbel Jeffers's discussion Office Reservation software
"Hi Kimbel. I know you've been tasked with finding a software solution, though I'm wondering if you may need an interim step first: Does your institution have checklists covering all of the steps needed in on-boarding, relocating, and…"
May 13
Kimbel Jeffers posted a discussion

Office Reservation software

I've been tasked with finding a software tool that helps manage the onboarding and exit process of new and departing faculty. Ultimately i would like this software to management faculty office interms of when resources can be removed from a particular office and when a new faculty member can be moved in with the necessary resources. This tool should have notifications and alerts so there are no conflicts with someone being removed from a office and someone being placed in a office. Does anyone…See More
May 11
Sara Michel commented on Lynn Zawie's group OmniUpdate
"Congrats to Harper College on going live with their new online course catalog! Looks great!"
May 10
Helen Mosher joined Aaron Rester's group
May 9
Helen Mosher joined Mark Greenfield's group
May 9

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

© 2013   Created by Mark Greenfield.

Badges  |  Report an Issue  |  Terms of Service