This project has moved. For the latest updates, please go here.

Chalk documentation

Feb 4, 2010 at 12:08 PM

Is there any documentation of all chalk "items" i can use in creating a theme? It's very frustrating to create one, if you want to customize anything, since there is no complete documentation

Coordinator
Feb 5, 2010 at 3:40 PM

That is something that needs to be documented very well, as there are so many different elements available in Chalk. It is based on NVelocity (which is based on Velocity) so you get all the language elements from that, plus the Graffiti-specific additions.

I am going to start working on pulling together the various NVelocity/Chalk documents that have already been written onto the Doc here in the near future. But here are some resources to get you started for now:

Chalk Overview -  http://graffiticms.com/support/advanced-options/chalk-overview/

Standard Chalk Items - http://graffiticms.com/support/advanced-options/standard-chalk-items/

Data Extension Commands - http://graffiticms.com/support/advanced-options/data-extension-commands/

Basic Velocity syntax guide - http://velocity.apache.org/engine/releases/velocity-1.5/vtl-reference-guide.html

NVelocity syntax enhancments - http://www.castleproject.org/others/nvelocity/improvements.html

 

Feb 8, 2010 at 10:52 PM

Thanx for that!

But there are still some functions, that you can find in default themes and are not documented anywhere.

But just from curiosity, I would like to show something on page only, if it's older than (for example) one month - so how to do that? Bolded part is sth i would like to get, but have no idea how.

#if($post.Published <= $today.AddDays(-20))
<h1>show something</h1>
#end 

 

Any ideas?

Feb 10, 2010 at 2:45 AM

You need to write a bit of code as a chalk extension to make it work, it would be very easy,I wrote it up myself and tested it out - works great.

using System;
using Graffiti.Core;

namespace GraffitiExtras.Extensions.Today
    
{
    [Chalk("today")]
    public class today
    {
        public DateTime AddDays(int days)
        {
            return DateTime.Today.AddDays(days);
        }
    }
}

Coordinator
Feb 15, 2010 at 7:02 AM

I was thinking about how to make these sorts of things easier to do without writing a bunch of custom macros for each function. So I looked at how the Caste Project Monorail is using NVelocity context and saw they inject static type helpers on every page request. This seemed like a pretty elegant way to let you access all of the static helper methods on the .NET types via plain Chalk.

With changeset 39743, you can now access the static helper methods of all of the standard .NET types via calling the type name. For example:  $DateTime.Today.AddDays(...)

The types available are:

  • Byte
  • SByte
  • Int16
  • Int32
  • Int64
  • UInt16
  • UInt32
  • UInt64
  • Single
  • Double
  • Boolean
  • Char
  • Decimal
  • String
  • Guid
  • DateTime

Let me know if you run into any issues with this or it doesn't behave the way you'd expect it to.

Feb 15, 2010 at 1:05 PM

cool, that sounds very cool, I'll try it out, just have to find time to update my site with latest build.

 

I have one more question - is $post.Published DateTime object? So that I can comare it with today.

Coordinator
Feb 17, 2010 at 5:04 AM

Yep the $post.Published value is a true DateTime object, so you can do that.

Mar 14, 2010 at 3:32 AM
Edited Mar 14, 2010 at 3:33 AM

It looks like now that Graffiti CMS is opensource, Telligent have removed their support forums. Going to any of the links posted above for Chalk documentation takes you to the same page that just says Grafitti CMS is now opensource and directs you back to Codeplex.

Is there any remnants of the Grafitti CMS documentation? So far I have been forced to use Google cached pages to learn it.

Coordinator
Mar 15, 2010 at 3:29 AM

Kevin is planning on getting it uploaded here at one point, but I know he has been busy with several things, so it may take some time to get to that point.

Mar 25, 2010 at 10:54 PM

It's pretty fucked up that the documentation has been removed and unavailable for so long, but you should be able to access the docco via wayback.org:

    http://www.archive.org/

Mar 25, 2010 at 11:26 PM

Thanks Digory. This Chalk overview is what I was looking for http://web.archive.org/web/20080424044429/http://graffiticms.com/support/advanced-options/chalk-overview/

I agree, it's a shame that the docs aren't available. But I understand and appreciate the work involved. Having limited documentation makes it harder than it could be to pick up GraffitiCMS for newcomers which is unfortunate, because it's such a great CMS! It reminds me of MODx which is a nicely componentized PHP CMS, but built with all the goodness of C# and .NET and actually has solid architectural foundations and separation of concerns, which MODx (and most PHP abominations) lack.

Now that it has gone opensource we need more than ever to build up the momentum for GraffitiCMS. Without docs makes it very hard for new developers like me to get involved and contribute.

 

Coordinator
Mar 30, 2010 at 8:56 PM
Edited Mar 30, 2010 at 9:10 PM

All the documentation that used to be on the GraffitiCMS.com site before it was shut down is now available here:

http://extendgraffiti.com/docs

Any embedded image files are missing, but I'm working on getting them restored. We need to start migrating the docs from their HTML format on that site to the documentation wiki on this CodePlex project. I'm sure some of the articles need to be updated for 1.3 as they are migrated over.

The organization is not very good (same categories as on GraffitiCMS.com), but you can use search. I'm hoping they can be reorganized as well when they are migrated into wiki format. If anyone would like to volunteer to start doing this, I'll add you to the "editor" role on this project so you have full wiki admin access. =)

BTW, the ExtendGraffiti.com site will be the default free marketplace service that Graffiti will be configured for on release. The marketplace stuff still needs some work, but wanted to have somewhere to put the docs for now until they are all migrated over.

Mar 30, 2010 at 10:40 PM

Thanks Kevin, can I suggest that you put a note on the CodePlex Home page to let people know where they should go to find documentation. 

Coordinator
Mar 31, 2010 at 12:15 AM

I could spend some time here and there copying content over. I think we could knock it out pretty fast.

What may take some time is adding more detailed lists of objects and methods available.

Coordinator
Mar 31, 2010 at 4:40 PM
Thanks Josh! Brian Zalk has also volunteered this morning to help migrate documentation over and update it. I got the images restored on the ExtendGraffiti.com/docs site and tried to fix up links between help docs by doing some bulk find/replace update queries. Let me know if you see anything still missing.
Coordinator
Mar 31, 2010 at 6:16 PM
Edited Mar 31, 2010 at 6:27 PM

How should we handle images? Here is the first wiki page I made with an image. http://graffiticms.codeplex.com/wikipage?title=View%20Files&referringTitle=Advanced%20Options
I just used this markup [image:nameofattachment.jpg] after I attached the image to the wiki page.

Did you want to do this another way? I thought about attaching the thumbnail as well and linking it but you'd need to use a full url with http:// to make it work.

Another example: http://graffiticms.codeplex.com/wikipage?title=Migrating%20Documents%20to%20Graffiti&referringTitle=Advanced%20Options

Coordinator
Mar 31, 2010 at 8:19 PM

The section I've found most useful, Advanced Options, has be completely transfered. http://graffiticms.codeplex.com/wikipage?title=Advanced%20Options

Coordinator
Mar 31, 2010 at 8:24 PM
That image attachment method looks good to me. Great job
Mar 31, 2010 at 9:55 PM

Great job... now whoever looks after @graffiticms just needs to tweet some life into it :-)

Coordinator
Apr 1, 2010 at 11:44 PM

I've finished copying everything over. Generally, there may be a few formatting tweaks to be made, but the limitation of the wiki markup allows us to do only so much. I've mostly used the thumbnail images from the original posts, only using the full size images in cases where the thumbnails were too small. This is because many of the full size screen shots were very large and the thumbnails seemed to get the point across just as well.

A few pages need some updating prior to the 1.3 release with specifics about that release which I do not have at this point.

Apr 2, 2010 at 12:38 AM

Great job!