Writing a custom Condition for Orchard - checking the tags on a page - published to GitHub and the Orchard Gallery

As promised in my first post about writing a custom Condition for Orchard, I've published the source code to GitHub and the Orchard modules gallery:

Just because I can, I've added an additional Condition to the module, that triggers off the Id of the content item (mainly because in some ways this is a strict subset of the functionality required for the tag based version). I've specified these as two distinct features within the module by using the following content for Module.txt:

Name: RW.Orchard.Conditions
AntiForgery: enabled
Author: Robert Wray
Website: http://robertwray.co.uk/
Version: 1.0.1
OrchardVersion: 1.10.0
Description: This module contains new conditions that can be used within Orchard
Category: Scripting
Features:
    RW.Orchard.Conditions.Tag:
        Name: RW.Orchard.Conditions.Tag
        Description: Adds a condition to Orchard that allows checking against tags
        Category: Scripting
        Dependencies: Orchard.Conditions, Orchard.Tags
    RW.Orchard.Conditions.ContentId:
        Name: RW.Orchard.Conditions.ContentId
        Description: Adds a condition to Orchard that allows checking against the items content id
        Category: Scripting
        Dependencies: Orchard.Conditions

the process of creating an Orchard Gallery account and making the module package available is something I'll document later, but, since I added the module to the gallery, I've then installed it via the Modules part of /Admin and it all works as it should do. I'll consider that a success!

About Rob

I've been interested in computing since the day my Dad purchased his first business PC (an Amstrad PC 1640 for anyone interested) which introduced me to MS-DOS batch programming and BASIC.

My skillset has matured somewhat since then, which you'll probably see from the posts here. You can read a bit more about me on the about page of the site, or check out some of the other posts on my areas of interest.

No Comments

Add a Comment