This project is read-only.

Templates - items zone restrictions

May 8, 2008 at 3:28 PM

I'm just wondering of why there are so strict zone restrictions for the template items?
For example, Text could be placed only inside content zone, teaser only in right and left zones, calendar teaser and
subscribe only in right zone, but not left, at the same time news list can be placed on left and right, but not at content zone, etc.

These restrictions looks strange and unnecessary.
May be templates itself should be perceived only as an example.

And if i want to change templates, for example to add new zone for some item, there is a license requirement that I should redistribute my changes and so on...
May 9, 2008 at 10:20 AM
Hi magdev

Templates only have strict zone restrictions if you specify the restrictions.
You can easily allow a template to be placed in all zones – but it’s a great feature that you as a developer, can setup some rules on how the backend user can create content.

By giving the attribute AllowZones the value null, you allow the template to be places in any/all zones.

N2.Definition("Top news")
public class TopNews : N2.ContentItem
// Template properties goes here...
May 9, 2008 at 12:35 PM
Hi hojgaard

I understand it. I'm speaking about templates which are already presented in the download section.
Such a strict restrictions prevents them from usage in a real web site, especially for non programmers.

May 9, 2008 at 9:20 PM

Thank you for bringing up inconsistencies in the tempaltes. I do like to improve them and feedback like this helps a lot.

When looking up the calendar I found that I had changed the zone names in the restriction specifications (a bug). This will be fixed in the next release.

In the case of the news list the reason is specific markup for the sidebar boxes (I'm a fan of semantic html). Does it make sense to add the list to the content zone? Please consider that there is a news container template that does this.

I started N2 as a closer to the metal CMS engine (it's the way I prefer it most of the time). One very common feedback I received was the lack of out of the box functionality. So I set out to build a set of templates to make it more attractive. The general idea was to give an implementation to use as a base for sites and to explore and improve the core framework. In this sense it should be percieved as examples and I'm very happy when it's used in this way.

The main problem with this approach is upgradability. As soon as I start tweaking the templates in my implementation I make upgrading them harder. One way out are the extendability features, e.g. subclassing a template and using the ReplaceParent attribute.

It might also be the answer to your licensing concerns. Not that I'm really sure what you're after. Do you want to build an improved implementation to sell with "closed source" as competitive advantage? I don't think there is anything in the license that forces you to give away your code for free and you're also free to use the extandability features and build improvements in another closed source library.
May 12, 2008 at 8:20 AM

IMHO the fully functional templates is the most important feauture. Their absence is suppresses spreading of N2, because most of users needs ready-to-use-system.
I understand that there are problems with upgradeability, but it's neccessary evil in our case.

Regarding license, I don't want to redistribute or sell it in any version, I just bother, that when I will use it on my company sites, if there will be needs for some changes in N2 core, then the license requires to open source for these changes. May be I misunderstood the license. Can anyone explain, what's requirements of the license in my case?
May 12, 2008 at 8:28 AM
Regarding items positioning, I'm sure that all really unneccessary restrictions should be removed.
In case of news list, for example, why not to place them bellow main content on home page? For example look at the Also there is very usefull two-column container, and again - it can be placed only within content, and within the two columns container could be placed only text item. Why not to allow place news list inside a left column, and some text at right column?
May 12, 2008 at 11:52 PM
You're absolutely right about the templates and I'm adding a news list for the content area.

My understanding is that since it's the library gpl (lgpl) you can use the extension points provided and develop how you prefer. From my point of view this includes replacing services through the windsor configuration and extending the templates. If you need to change the core maybe there is the need of a new extension point.