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. :)

Views: 173

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

Sara Kisseberth posted a discussion

Archived magazine stories

Greetings,What are you all doing online with "old" magazine stories? Do you delete issues after so  many years? 5 years? 10? I'm torn between keeping all on for historical purposes or keeping just a few years online to simplify the site (ala Gerry McGovern.) Curious as to what you see best practices being.ThanksSara KisseberthBluffton Universitywww.bluffton.eduSee More
Jun 10
Erin Jorgensen posted a discussion

HighEdWeb 2020 Accessibility Summit

The HighEdWeb 2020 Accessibility Summit is a one-day, online conference about digital accessibility in higher education happening June 25, 2020, from 10 a.m. to 5 p.m. CDT.Join in to learn best practices, share stories and connect with your higher ed peers on topics including social media accessibility, web development, user experience and more. Sessions are designed to boost knowledge at every level, from accessibility beginners to technical experts. Conference registration is $25, with…See More
May 29
Erin Jorgensen is now a member of University Web Developers
May 29
Christine Boehler posted a discussion

HighEdWeb 2020 Annual Conference - ONLINE

October 19-20, 2020https://2020.highedweb.org/#HEWeb20     Join us ONLINE for HighEdWeb 2020, the conference created by and for higher education professionals across all departments and divisions. Together we explore and find solutions for the unique issues facing digital teams at colleges and universities. In 2020, the Conference will be held completely online, offering multiple tracks of streamed presentations, live…See More
May 3
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Throughout April, we're hosting webcasts exploring how colleges and universities across North America are responding to the COVID-19 pandemic. Register for the series today! https://bit.ly/2xsXhK9"
Apr 13
Christelle Lachapelle is now a member of University Web Developers
Apr 6
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Download our latest white paper to learn how the demographics of today’s higher ed learners are shifting, and how schools can adapt to meet the needs of these new learners. https://bit.ly/2wTKdgB"
Mar 31
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Join our next webcast with Amrit Ahluwalia from The EvoLLLution to learn about the new "modern learner" in higher education. https://bit.ly/2UuDh2I"
Mar 30
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"As we ride out the latest developments and impact of the coronavirus, there's no better time than now to learn the three Bs of crisis planning. http://bit.ly/2ITVkc2"
Mar 16
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Is your college or university prepared to meet the challenges that come with disasters and emergencies like the coronavirus? Learn how your CMS can help. http://bit.ly/2TUZUM8"
Mar 12
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"Can’t afford the time and money to launch a comprehensive guided pathways model? Register for our FREE webcast to learn tricks for simulating a digital guided pathways experience."
Feb 21
Sara Arnold commented on Lynn Zawie's group OmniUpdate
"With college enrollment decreasing for the 8th year in a row, boosting your college or university marketing efforts is more important than ever. Here's how to get started. http://bit.ly/2vTQAzz"
Feb 20
Christine Boehler posted a discussion

HighEdWeb 2020 Annual Conference

October 18-21, 2020 in Little Rock, Arkansas, USAhttps://2020.highedweb.org/#HEWeb20     Join us for HighEdWeb 2020, the conference created by and for higher education professionals across all departments and divisions. Together we explore and find solutions for the unique issues facing digital teams at colleges and universities. With 100+ diverse sessions, an outstanding keynote presentation, intensive workshops, and engaging networking events,…See More
Feb 19
Christine Boehler posted a discussion

HighEdWeb 2020 Call for Proposals is Open!

The 2020 Annual Conference of the Higher Education Web Professionals Association (HighEdWeb) will travel to Little Rock, Arkansas, this October 18-21 — and the call for proposals is now open! As a digital professional in higher education, we know you have great ideas and experiences to share. From developers, marketers and programmers to managers, designers, writers and all team members in-between, HighEdWeb provides valuable professional development for all who want to explore the unique…See More
Feb 14
Christine Boehler shared Sara Clark's discussion on Facebook
Feb 14
Christine Boehler is now a member of University Web Developers
Feb 14
Brian Bell joined Kevin Daum's group
Feb 14
Brian Bell joined Mark Greenfield's group
Feb 14
Kenneth George is now a member of University Web Developers
Feb 13
John Sterni is now a member of University Web Developers
Feb 6

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

© 2020   Created by Mark Greenfield.   Powered by

Badges  |  Report an Issue  |  Terms of Service