Archetype - Hacky? How?

395 views
Skip to first unread message

Lee Kelleher

unread,
Jan 21, 2015, 8:21:54 AM1/21/15
to umbra...@googlegroups.com
OK, this could be a controversial topic...

When I chat about Archetype with people in the community, the general reaction is "awesome" - whereas the general reaction from the core team is it's "hacky".
(a sweeping generalisation - based on conversations I've had, and tweets I've seen)

As a package developer, I am genuinely curious - How is it hacky? and what can we learn from it? (for future property-editors)

With love,
- Lee x

Aaron Powell

unread,
Jan 21, 2015, 8:59:33 PM1/21/15
to umbra...@googlegroups.com

What’s ‘Archetype’?

--
You received this message because you are subscribed to the Google Groups "Umbraco development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umbraco-dev...@googlegroups.com.
To post to this group, send email to umbra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/umbraco-dev/5cad3144-2c98-46ca-9d75-ef6cffccc941%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Terris

unread,
Jan 22, 2015, 5:34:48 AM1/22/15
to umbra...@googlegroups.com
I'm quite keen to read any opinions on this, since I use the package quite a lot

Richard Terris

unread,
Jan 22, 2015, 5:37:38 AM1/22/15
to umbra...@googlegroups.com


On Wednesday, 21 January 2015 13:21:54 UTC, Lee Kelleher wrote:

Niels Hartvig

unread,
Jan 22, 2015, 5:39:10 AM1/22/15
to umbra...@googlegroups.com
Without going into technical details or talking specifically about Archetype, a property editor that heavily modifies how content is edited, published and queried also heavily modifies Umbraco defaults, thus needs to cope with things that becomes out of core Umbracos control such as performance, etc. As Umbracos convention is that one property editor handles one item of content with potentially links and macros, the core of Umbracos publishing and rendering engine is optimised for this (even the Grid works this way). What we've seen in some implementations that takes advanced property editors such as Archetype to extremes is that the site and what's going easily gets out of control for the developer who implements it resulting in performance and UX issues which is unfortunate.

The downside of Umbraco being flexible, is that with great flexibility comes great responsibility and you can end up customizing Umbraco so much (through custom editors, data mappers, code first, etc) that it's less of Umbraco and more of your custom cms. This doesn't *have* to be bad, it just mean that you need to know what you're doing and your client needs to know that as well.

/n

Aaron Powell

unread,
Jan 22, 2015, 5:48:54 AM1/22/15
to umbra...@googlegroups.com

Remember Niels –

http://firebirdcrossfit.com/wp-content/uploads/2013/07/with-great-power-comes-great-responsibility-spider-man.jpeg

 

;)

--

You received this message because you are subscribed to the Google Groups "Umbraco development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umbraco-dev...@googlegroups.com.
To post to this group, send email to umbra...@googlegroups.com.

Richard Terris

unread,
Jan 22, 2015, 5:50:33 AM1/22/15
to umbra...@googlegroups.com
A good response.

I agree it's something which could impact performance if not handled correctly, but I have a page which has a fairly complex multi-level Archetype property resulting in a large complex json array; I'm deserializing it and adding it to a strongly typed viewmodel and the page is loading on average in 400ms

Aaron Powell

unread,
Jan 22, 2015, 5:59:22 AM1/22/15
to umbra...@googlegroups.com

As an armchair observer (ie – someone who’s known about it for the whole of 10 minutes) I’m going to agree with the hackiness of it. Trying to make a generic component to solve the problems it allows you to solve means you’re going to have a lot of sacrifices, performance being one of them.

 

I’m of the opinion that when something is unique for my situation I should build something that does exactly what I need rather than try and massage something to do it. This feels like that.

 

But then again I’m not making as many sites as most people on here are so I might be disconnected.

 

From: umbra...@googlegroups.com [mailto:umbra...@googlegroups.com] On Behalf Of Richard Terris
Sent: Thursday, 22 January 2015 9:51 PM
To: umbra...@googlegroups.com
Subject: Re: Archetype - Hacky? How?

 

A good response.

--

You received this message because you are subscribed to the Google Groups "Umbraco development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umbraco-dev...@googlegroups.com.
To post to this group, send email to umbra...@googlegroups.com.

Robert Foster

unread,
Jan 22, 2015, 6:34:10 AM1/22/15
to umbra...@googlegroups.com

I’ve used Archetype on exactly 2 projects – one was used to create a highly flexible home page, the other was to create a flexible set of slides in a customisable slideshow.  The former quickly caused problems with editing data when the data set and nested definitions became too unwieldy, while the latter was quite elegant and lightweight.

 

I’d have to agree that it feels “hacky”, and misused could severely compromise the content.

 

But I know there are people out there with a lot more experience with it than I have…


For more options, visit https://groups.google.com/d/optout.

This email message and any attachments are confidential and subject to copyright. If you are not the intended recipient, any use, interference with, disclosure or copying of the material, is prohibited and unauthorised. If you receive this email in error, please advise our offices on 03 5282 4246 and delete this email and any attachments immediately.

Thank you.

Richard Terris

unread,
Jan 22, 2015, 6:48:05 AM1/22/15
to umbra...@googlegroups.com
@Robert - I'm (and I'm sure everyone is, including and especially Lee) really keen to hear about people's experience with Archetype; can you give more detail on the problems you ran into?

As I said in a previous comment, I've got a fairly complex setup and (so far) not experiencing problems.

To put this into context - I agree that anything like this is probably 'hacky', inclduing Grid and by that I mean that we're kind of breaking away from what Umbraco does well in order to deliver more flexibility and that in itself is always going to bring problems and challenges.
We've started using this to replace Sir Trevor which we were using and ran into serious issues (such as richtext editors remembering content from other nodes if Sir Trevor datatypes existed on the nodes).

I'd also be keen to get a high level overview from @Niels or one of the team as to how Grid works, particularly compared to something like Archetype.
I don't know enough about the Grid but I imagine it must be using json in a similar way to Archtype?

As ever, these comments and questions are with the best of intentions. I'm as curious as Lee and striving towards the best solutions.

Robert Foster

unread,
Jan 22, 2015, 6:56:01 AM1/22/15
to umbra...@googlegroups.com

It was a while ago, from memory the archetype editor would not render correctly under some circumstances, particularly as the amount of content in it grew – we had nested archetype as well to probably 3 or 4 levels to handle different “views” in each column on the page.

 

This problem was fairly well documented in forums and the like though… and a solution was found (probably increasing the room for JSON in the prevalues maybe).

 

End result worked, and the home page rendering can be seen here:  http://larasc.vic.edu.au.  Everything’s configurable, including what type of views get included in tabs at the top of column 3…

 

Robert Foster

Director, Development

 

Microsoft Certified Solutions Developer  - Web Applications /  Umbraco Certified Developer

 

0418 131 065  /  03 5282 4246  /  rob...@digitalsmith.com.au  

  

cid:A1EB2BF8-916B-4DFF-82D0-30FBA70FA3FA

 

w digitalsmith.com.au  /  t @_digitalsmith_  /  f craftingyourdigitalpresence

a 11 Haydn Street, Lara, Victoria, 3212


For more options, visit https://groups.google.com/d/optout.

Richard Terris

unread,
Jan 22, 2015, 7:10:28 AM1/22/15
to umbra...@googlegroups.com
Nice design!

If I'm understanding correctly then we had the same issue with Sir Trevor - the length of the json was too large for the database field.
I'd be quite interested in seeing the json for that page if it's available somewhere?

Robert Foster

unread,
Jan 22, 2015, 7:17:00 AM1/22/15
to umbra...@googlegroups.com

Will see what I can do…


For more options, visit https://groups.google.com/d/optout.

Robert Foster

unread,
Jan 22, 2015, 7:27:08 AM1/22/15
to umbra...@googlegroups.com

Okay, Content JSON for the home page of that site: http://pastebin.com/iek2TKN4

 

J


For more options, visit https://groups.google.com/d/optout.

This email message and any attachments are confidential and subject to copyright. If you are not the intended recipient, any use, interference with, disclosure or copying of the material, is prohibited and unauthorised. If you receive this email in error, please advise our offices on 03 5282 4246 and delete this email and any attachments immediately.

Thank you.

Richard Terris

unread,
Jan 22, 2015, 7:35:19 AM1/22/15
to umbra...@googlegroups.com
I appreciate that @Robert.

It's quite a complex object but it's not hugely different from what I'm working with.

Admittedly the page I'm looking at is local but the speed is 500ms compared with your 5 seconds and I haven't introduced any caching yet.

We can chat more privately if you're interested, as we're starting to hi-jack this topic a bit.

Hopefully we'll get more chat from different users and members of the core team :)

Dan Diplo

unread,
Jan 22, 2015, 8:55:52 AM1/22/15
to umbra...@googlegroups.com
That's interesting to hear. But, personally, as a developer, I think Archetype is one of the best things to happen to Umbraco. Indeed, it's one of the reasons our company embraced 7, as it makes life so much easier both for developers and content editors. 

For instance, in pre-Archetype days if we'd needed a carousel/slider on the homepage then we'd have to create a document type as a "container" (with no template) into which individual "slider" doctypes were added (again with no template). So you ended up with something like this structure in the content tree:

Home
  • Slider
    • Slide One
    • Slide Two
    • Slide Three
You then have to write code that finds the folder and renders each slider item. It's confusing to many content editors, as the content that appears on the homepage isn't managed from the homepage.

But with archetype you can easily create repeatable "slide" elements, all managed from a Tab within the homepage. This means you can leave the content tree free to just contain pages - so that an Editor knows there is a 1 to 1 relationship between a node in the tree and what they see in their sitemap. No need for "container" doctypes that have no template (but still have a URL that raises a 404). You can also easily limit the number of items in an archetype (whereas you can't with child nodes).

Obviously, you wouldn't put hundreds or even dozens of items in an archetype. But where you need a few repeatable items or blocks on page, it is awesome. 

So I'd go as far as saying that if Archetype is considered a "hack", then change Umbraco so it is not a hack. Because it is, to me, an essential datatype that I couldn't do without. And all the devs I know who use it agree.


On Thursday, 22 January 2015 10:39:10 UTC, Niels Hartvig wrote:

Webmonger

unread,
Jan 22, 2015, 9:57:56 AM1/22/15
to umbra...@googlegroups.com
+1 Dan

The use of the CMS is not for developers it's for the end user, if Archetype does what they need then a developers hack == users requirement. It happens everywhere with everything but it's always good to remind ourselves we're not building these tools for ourselves but for the end users.

Niels Hartvig

unread,
Jan 22, 2015, 11:16:04 AM1/22/15
to umbra...@googlegroups.com
Archetype is great for the simple things as Dan mention (which is also what it was designed for originally and why I endorsed it when it came out), but since it got increased in size and we've seen some quite unfortunate site effects when people start doing things like this (especially when they don't know *how* archetype works): http://blog.imulus.com/tom-fulton/building-inline-complex-content-in-umbraco-with-archetype

We built Grid Layouts for exactly that purpose which is optimised for the editor experience rather than the dev experience, but in all fairness that wasn't out when the above blog post was published. 

I'd love a simple (the original) edition of Archetype in the core for repeatable content but right now it has - for some - turned into the hammer that makes everything look like a nail and I think that's very unfortunate. Both for developers and editors.

/n

Robert Foster

unread,
Jan 22, 2015, 11:23:03 AM1/22/15
to umbra...@googlegroups.com

I wholeheartedly agree – this has been my experience also with the two examples I cited earlier – things like relatively complex slideshow content is what Archetype excels in – trying to layout an entire page maybe not so much.

 

 

From: umbra...@googlegroups.com [mailto:umbra...@googlegroups.com] On Behalf Of Niels Hartvig
Sent: Friday, 23 January 2015 3:16 AM
To: umbra...@googlegroups.com
Subject: Re: Archetype - Hacky? How?

 

Archetype is great for the simple things as Dan mention (which is also what it was designed for originally and why I endorsed it when it came out), but since it got increased in size and we've seen some quite unfortunate site effects when people start doing things like this (especially when they don't know *how* archetype works): http://blog.imulus.com/tom-fulton/building-inline-complex-content-in-umbraco-with-archetype

--

You received this message because you are subscribed to the Google Groups "Umbraco development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umbraco-dev...@googlegroups.com.
To post to this group, send email to umbra...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Robert Foster

unread,
Mar 11, 2015, 9:10:37 PM3/11/15
to umbra...@googlegroups.com

Hey Kevin,

Thanks for replying to the thread on this – it’s actually clarified the way I think about Archetype and how it can/should be used – for things like highly customizable slides in a slideshow I’ve had a lot of success with it; and tend to use it over and over again for this kind of use-case.  I’ve also built a 3-column home page layout with Archetype and while it works, it was a little painful to implement, and just didn’t feel quite right.

 

I don’t go out of my way to try and make it fit every situation or over-engineer a page with it, but used in the context that you’ve addressed here it’s a perfect fit, even if it is a hack.  It most certainly isn’t Grid, and for things like the Slideshow example above Grid would not be a good fit whereas Archetype is perfect.

 

Just my 2 cents J

 

 

From: umbra...@googlegroups.com [mailto:umbra...@googlegroups.com] On Behalf Of Kevin Giszewski
Sent: Thursday, 12 March 2015 11:55 AM
To: umbra...@googlegroups.com
Subject: Re: Archetype - Hacky? How?

 

Wow, I missed this thread and it seems Archetype was on trial here.

 

I created it to solve a particular problem:  Allowing the editor to create a variable amount of inputs at run-time as opposed to committing to a hard number at design time.

 

It is a hack.  It is overused by some, but there is still no core solution for the original problem.

 

Grid != Archetype and I'm not sure why they get confused.

 

Archetype excels at building short lists of items and was never intended to represent pages.

 

Innovation has positive and negative side effects.  

 

I feel that Archetype has contributed positively by really pushing the limits of Umbraco.

 

It would seem that there is negativity being directed to toward me which is very discouraging.

 

I enjoy Umbraco as a product.  I evangelize it.  I give back to it as much as I can.  

 

@Niels: Apologies for failing the core team.

--

You received this message because you are subscribed to the Google Groups "Umbraco development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umbraco-dev...@googlegroups.com.
To post to this group, send email to umbra...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

Message has been deleted

jes...@jesper.com

unread,
Apr 1, 2015, 1:33:32 AM4/1/15
to umbra...@googlegroups.com
Hi all,

I just want to add a real world example and learn what you think. I can tell from the discussion above that we are doing it completely wrong so far but our experience is another ;)

We've been using the Archetype for a few projects and lately we've also used it for building "story pages" containing around 5-10 frames. The Archtype contains 10+ different fieldsets. Each fieldset again can contain a few smaller archetypes amongst the other properties.

What we've learned from clients:

The clients understands it and loves it.
They are carried forward and really does seem to understand immediatly.
They are not afraid to try as it seems the Archetype setup does a pretty good job ensuring they can only make the right choices allowing them to feel they are empowered (while too much flexibility seems to make clients insecure)
It seems rock solid.

What we've learned while implementing:

It's really fast to work with for configuring pretty complex layouts.
We can edit the config using text editors (and paste it into datatype)
We can copy paste configs betw datatypes. Even betw solutions.
We have experienced no performance problems. At all.


Alternatives - Grid

At the time we started the projects the Grid type didnt seem to be completly ready. There we still too many issues. Also we evaluated that it would take much more time to implement the same features as it would require dev'ing property editors en masse. Not a problem but with Archetype we reduced it from 20 to a few image editors.


We even tested the Grid on a client before deciding. We took the Fanoe starter and showed it in two versions: the original with grid and with grid replaced with Archetype. We didnt tell them what was new or native. They liked the grid (looked cool but confusing) but it seemed easier to understand the Archetype. Also they had some UI issues (they seem solved by now btw).


Feedback

Please let me know why this seems hacky?


All the best
Jesper

tom.f...@imulus.com

unread,
Apr 1, 2015, 2:25:03 PM4/1/15
to umbra...@googlegroups.com, jes...@jesper.com
I also just finally got around to testing the Grid on a real-world example as a replacement for using Archetype to build pages. It looks and behaves awesome! But the biggest challenge I'm seeing is how to work with more structured content.

For example, I want to have a full-width row called a "Case Study Row" that contains an image, headline, logo, blurb, link, etc, then format it in a specific way. I can't seem to do this in the Grid - I can create a "Case Study Row" but I can only define the number of columns, then editors can add whatever they want inside of it. This is awesome for allowing the editor flexibility to do whatever they want, but makes it harder to create structured pages that are easy to populate and consistent. I don't want them to have to have to think about what components are needed for a case study row, or how many columns it's supposed to be, nor do I want them sticking extra elements inside of it.

I suppose I could achieve this by writing a custom Grid Editor with all the fields needed for a Case Study, but this seems like extra work and still leaves some usability issues.

I'd be curious to know if I'm thinking about this wrong or am missing a feature!

-Tom

Pavel Budík

unread,
Apr 2, 2015, 8:12:13 AM4/2/15
to umbra...@googlegroups.com, jes...@jesper.com, tom.f...@imulus.com
And what about creating a datatype wrapper grid editor to place Archetype in Grid? I have tried it and with some hacks in Archetype core, it works :). See https://github.com/WebCentrum/Archetype/commit/2d839e03c7308df717099e61f252b00012dc8b6b, https://github.com/WebCentrum/Archetype/commit/780bcd70cfc12ede7062f9d68fd4d6dcc1a417ca and https://github.com/WebCentrum/Archetype/commit/71631c378e2f82f97a85b524ec47be2f5d463af4 - then there is the datatype grid wrapper and methods to obtain data. If someone would be insterested, I could probably also find a moment and put it all on GitHub.

ba...@barryfogarty.com

unread,
Apr 2, 2015, 10:28:03 AM4/2/15
to umbra...@googlegroups.com
Hey Tom - check out Lee K's and Matt B's recent work on adding doctypes to the grid:

https://our.umbraco.org/projects/backoffice-extensions/doc-type-grid-editor
http://uhangout.co.uk/video/r_-kWBJkUC8

It's a big help when entering structured/enumerable content, while maintaining the layout flexibility offered by the grid.
Reply all
Reply to author
Forward
0 new messages