Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:29:10+00:00 2026-06-09T01:29:10+00:00

I have an Orchard cms module with some additional Content types set up and

  • 0

I have an Orchard cms module with some additional Content types set up and have added an AutoRoute component via code.
Everything works perfectly, however I am not happy with the default permalink pattern.

What I am trying to do is add a custom pattern and use one of the public properties in my content type. In my case the custom type has a public property called ClubName and I would like that to be used (It makes more sense from a routing perspective).
The Orchard part class name is called TrackPart.

I have tried {Content.TrackPart.ClubName}, {Content.Track.ClubName}, {ContentItem.TrackPart.ClubName},{Content.TrackPart.ClubName} and various other variations but nothing seems to be working.

I am really new to Orchard so there is a high chance I am missing something simple.
Any help would be greatly appreciated.

In response to feedback from @Bertrand-le-roy I created my own token by copying an example token. I can now get see the token in the drop down menu and select it. However the route pattern is still not working.

I can only assume that I have misunderstood the Evaluate() function’s context.For usage. It looks like I am not getting the data I need

Here is what I have so far.

public class TrackPartTokens : ITokenProvider {
private readonly IContentManager _contentManager;

    public TrackPartTokens(IContentManager contentManager) {
        _contentManager = contentManager;
    }

    public Localizer T { get; set; }

    public void Describe(dynamic context) {
        context.For("Track", T("Track"), T("Tokens for Track"))
            .Token("ClubName", T("ClubName"), T("The name of the club."))
            ;
    }

    public void Evaluate(dynamic context) {
        context.For<TrackPart>("Track")
            .Token("ClubName", (Func<TrackPart, object>)(field => field.ClubName))
            .Chain("ClubName", "ClubName", (Func<TrackPart, object>)(field =>field.ClubName))
            ;
    }</code>

The above code was based on the DateTimeField token inside the Orchard.Fields module.

context.For("DateTimeField")
.Token("Date", (Func)(field => field.DateTime))
.Chain("Date", "Date", (Func)(field => field.DateTime));

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:29:12+00:00Added an answer on June 9, 2026 at 1:29 am

    You’ll have to make your own token. It’s really easy. Copy a working example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have declared some Non-Content data in an Orchard CMS by defining the records
I have created a new module in Orchard CMS, i have a new event
I'm very new to Orchard CMS and I have started writing my first module.
I have been stepping through the source code for Orchard CMS to learn how
I am new to orchard CMS. I have downloaded the source code from http://orchardproject.net/
I currently have a page within Orchard CMS, it only has content on it.
I'm working on building a custom module in Orchard CMS, and I have the
I created a custom module for Orchard following this wonderful guide . I have
I have created an orchard cms blog with a url like www.testurl.com I would
We have WebServer (based on Orchard CMS ) and two SQL Server databases: master

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.