+Sean Beaverson Inspired me to finally write this script -- can't think of a clever name or an imaginitive GIF yet -- with the working name "studentPageCreator."  In contrast to some other full ePortfolio solutions out there, this script merely creates a page per student on an existing Google Site.

Here's what it does:

-- Takes the URL of an existing Google Site and uses a list of students (with email addresses) to generate a page per student.

-- Allows you to construct the page titles in the spreadsheet.

-- Allows you to position the student pages underneath any page on your site.

-- Lets you use standard Sites templates, or specify any custom page template you've created.

-- Due to limitations in the Apps Script API, this script DOES NOT use "Page-Level Permissions". As a workaround, all students will be added as top-level editors to the Site.

-- Runs entirely from a single UI panel.  Super simple to deploy.

Please help test it out.  Make a copy of the spreadsheet that contains the code here:


Others who will definitely be interested in checking this out:
+Bjorn Behrendt +Graham Bowman +Lucie deLaBruere 

Also looking for good names / logo ideas;)
Kim Flowers (Kimmy)'s profile photoSean Beaverson's profile photoNatalie O'Neil's profile photoAndrew Stillman (Personal)'s profile photo
Awesome! Will be testing out next week!
Awesome! !!!!!!!!! Thank you, Andrew!
Yes definitely interested. How easy would it be to have an option to set all users as viewers rather than editors? Then they could be set as individual editors manually. 
Thank you! I'll give it a once over this evening.

Beavers are pretty funny :-) But seriously hiveSite hivePages. +Benjamin Friesen hosts a multi-district workshop called the Hive. Maybe it fits. Everyone working together to make something sweet!
Works a treat! Thanks. Could you add a optional 'send email' with the link to the page? Users w/in the domain do see it in My Sites, but email could be nice. Maybe a second menu choice.

I did test it w/ a mix of accounts w/in the domain and other comercial Gmail addresses. The Gmail user doesn't see the site listed in My Sites. I don't know if it shows sites from other domains or not. That's another reason the email would be good.
Alright, I've gone ahead and added some features, per the various requests:

Thx to +Jay Atwood suggestion the script now sends notification emails when new pages are created.  Also has an option NOT to send, and to re-send notifications to all previously-created pages (in case kids need a reminder).

+Graham Bowman will be happy to know that it now provides users the choice of whether to add students as top-level editors or viewers.

Additional features:

-- now looks up last update time on page and all sub-pages to the student site and returns the most recent edit time.  (this means that Announcement type pages return the time of last post!)

-- allows you to send custom feedback emails to all students in the sheet

Naming and branding choices:

I think I want to call this "pageMeister" and I've landed on an oompa Loompa as the icon.  Sorry +Sean Beaverson I've spent too many years teaching high school to foist a beaver on my colleagues who teach adolescents;0

Here's a link to the Icon:

+Andrew Stillman I was thinking of names... Siteclops (like cyclops from mythology, make a gif of a one-eyed giant)  or Sitetopolis (or spelled Sitopolis, & gif could be a city skyline being built). Just some ideas, hope you don't mind!
This is great! I've had a play around this evening and it all seems to work as expected. It's going to save me and others lots of time. I prefer this method over the Hopefully it's a matter of time until page level permissions can be added. 

I think my first project to use this will be to have students upload a wmv to their Drive and add it to their individual page. Good for peer assessment.
Who doesn't love an oompa loompa? Great work.
+Andrew Stillman figured you wouldn't take the bait on the bad name, but I too taught adolescents and doctopus? :-)

We just finished reading Charlie and watched the Depp version, so Oompla Loompa's have been on my mind. Convergence, I guess.
Ha! Beavers are definitely a riot. My son's nickname is Beaver, so we have all manner of beaver nicknames flying around the house. I got to Oompa Loompa by searching oompa bands looking for somebody in leiderhosen who might conjure the pageMeister.

Curious about where to take this.  Was playing this evening with merge tags to personalize the page content and it seems to work.  Things could get interesting here;)
Could I suggest a school mode for the script? We'd add a column in the sheet for the URL of the sites and then be able to blast them out for all students in one go.
I see...so you'd probably need a column for siteURL and a column for parentPageURL so the script knows where to put the pages in each site.
+Jay Atwood I'm not sure that a school mode would save substantial time, as I think about the workflow,  problem being that the URLs of each parent page and template would have to be known ahead of time.  Using the script as it is, the admin could run it in batches, each time ensuring that the correct parent page and template are selected (the UI ensures these are valid in the current arrangement).  Thoughts on this?
The current teacher mode is pretty simple to do. Here's our use case. We use Sites for our Interim Semester courses - a weeklong educational field trip to locations all over the world. 1200 students on 60 trips from New Zealand to Nepal to Tanzania & London -- wanna come along?!

That's 60 sites we are going to generate off a common template in advance. Once students sign up it would be better to run pageMeister as a batch to create their personal project/reflection page. We know each site's structure so it's only the URL that would change. I want to centralize it if possible. It's not a deal breaker to run them individually, but a script would be convenient. 
Wow!  That sounds like my dream school.  Very convincing use case.   I can experiment a bit.  Not sure whether a custom page template for one site is allowed to be used on another site.    You're also likely to hit usage quotas in that scenario...nothing is listed on the Apps Script dashboard for the Sites service but perhaps +Eric Koleda can shine some light here.    What are the enterprise quota limits for site and page creation?
I don't know offhand but I can look into it further.
I get a Cannot read property "length" from undefined error when I try and run. What must I be doing wrong?
You are an absolute life-saver! I've been trying to find something like this for months! I'm running it for a 'conference'-like website that students are required to 'register' for. But it meant I had to manually add them and create pages every time a student registered! 
Next challenge - can you be a magician and find how we can arrange it for group work pages? :P
Thank you so very, very much for this!!
+Kim Flowers Hmm. Not seeing anything obviously wrong with the sheet, except that you've got a blank value for page title in one row.  I'm assuming you linked it up to a Site and selected the page type or template that you want to use, and that the account you are running in has ownership rights on the site you want to generate pages for?
+Kim Flowers what error are you getting? I've occasionally run into an issue where it creates a page for the first line, but then seems to hang up. I run it again and it repeats the first page again... And again...

Curious if you're experiencing the same thing. 
I ran the script again (just for laughs) and for some reason it worked this time... But I get the error "Error encountered: Cannot read property "length" from undefined. "
Can you share me as an editor on the sheet and as an owner on the test site as well so I can pull the transcript and see exactly where this error is coming in?
That there is the error I've run into. I'm excited to hear end results. 
Can I "rerun script" if a new student joins my class like I can with gClassFolders?
OK - responded to your post to the siteMaestro group and elsewhere on G+ this eve.  Not sure if you encountered a bug or just a confusing interface on step 1.  The Add-on inserts a new sheet that you are meant to use to build your roster.  Can you try again and let me know how it goes? Preferably on the siteMaestro thread.
Add a comment...