So I've run into an issue with geneva. It's not a programming problem, it's conceptual. This is sure to be boring, but I'll just write it out in the hopes of making it more clear to myslef.

You build pages in geneva by selecting templates. Templates are basically HTML files. You can either use a pre built template, or use the browser based HTML editor to make your own. The only difference between a geneva template and a regular HTML file is that templates can contain "containers" which hold editable parts of the page. You insert containers into a template by like this: {{container name}}, where "container name" is any name you choose. Then you define your container on another admin page. Containers can be "textareas" (which gives you an editable piece of text), "snippets" (which are like textareas, but specifically for HTML, CSS, or Javascript code,) "blogs", "images", and eventually things like "photo galleries", "sign up forms", and any other type of component I make.

So far so good. One of the powerful things about containers is reusability. Once you define a container you can insert it into any page. So, image you have an image for your site logo. You create a container called, say, "logo", define that container as an image component, and upload your image. Now you can just put {{logo}} into any page you create and this will be rendered as your uploaded logo image. If you then edit the logo container and change the image it will be updated on all pages of the site.

The problem I am having has to do with naming the containers. I want to have a central repository of pre built templates. These templates will of course include containers since this is the whole point of geneva - making pages which are editable by the site admins. But since you choose your own names for containers, this might lead to problems. A template might specify a container called "main" which holds the main content of a page (say a textarea with a bio for an /about-us/ page.) But you might have already used the name "main" for a different type of container. If so, when you choose the prebuilt template with container "main", instead of getting the intended textarea, you might get a blog, or an image gallery, or whatever component you have previously assigned to the "main" container.

The typical solution here is something like name spacing. I could prefix every container name with the template name. So if you choose a template called, say, "minimal two column", and it contains a container "main", that container would actually have the full name something like "minimal two column : main". Now there can't be any collisions between similarly named containers in different templates. Problem solved.

Except no, because although that would be useful in some situations (where you don't want collisions) it defeats another of the powers of containers: reusability. Sometimes you want the same container to work across multiple templates. Take our original logo container as an example. In this case you want the container "logo" to be the same no matter which template a page is using so that future updates to the contents of "logo" (i.e., you upload a new image when your logo changes) update all pages.

So how do I make it so that I can build new templates with containers that can be used by anybody with a geneva web site, without knowing ahead of time whether a particular geneva web site already has a container specified with that name?

I think the solution is in this direction: templates specify empty containers. Like: {{ }}. Then when you choose a template to use you have to name the containers. But I don't like the extra step this involves. I'd like a site builder to just be able to drop in new templates and have them immediately work. I don't think there is a way around this issue.

Maybe (now I'm just thinking out loud here which I guess is the point) templates can specify containers differently. Something like {{{ }}} and inside have not a container name, but the suggested component. So the template would initally have containers like {{{image}}}, or {{{textarea}}} or {{{blog}}}. And when you choose a template for a page, and then view that page for the first time, you see each container with a default version of that component (a default geneva logo for {{{image}}} containers, lorum ipsum text for {{{textarea}}}, etc...). Then you just edit the page as normal (which is super easy and I'm really excited about this part, but that's another story...) and replace the default content with your own.

Hmmm. Would that work?

 


- jim 5-31-2013 4:01 pm




add a comment to this page:

Your post will be captioned "posted by anonymous,"
or you may enter a guest username below:


Line breaks work. HTML tags will be stripped.