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 6094771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:43:07+00:00 2026-05-23T12:43:07+00:00

This is a generalization of my previous question about pluralize filter: Does lift have

  • 0

This is a generalization of my previous question about pluralize filter:

Does lift have an equivalent of Django’s tags and filters?

Tags are small piece of predefined code that can be used directly in html template, for example:

{% now "jS F Y H:i" %}

renders the time right now in the given format.

Filters

Filters operate (in html template) on the context variables in the template, for example:

{{ value|capfirst }}

if called on a value “john” will result in “John”. Or:

{{ value|length }}

will render the length of the string into the template.

As you can see the filters operate on the context variables that are passed to the template.

  • 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-05-23T12:43:08+00:00Added an answer on May 23, 2026 at 12:43 pm

    Considering tags, you could define those yourself with snippets.

    As snippet is basically a callback much as a Django tag is. You don’t get any easier syntax, though, because Lift’s templates are pure XML/Html.

    <Lift:Tag.now format="jS F Y H:i" />
    

    And the logic would be defined in

    class Tag {
      def now: NodeSeq = // ...
    }
    

    Filtering is something you generally can’t do in a Lift template because Lift doesn’t allow any variables in a template. The whole concept is thus inapplicable. (You could do XML transforms or or bind magic but that would be a bit too much for a simple value.length.)

    No, if you need the length of some value in your Html, you will have to define that inside the snippet and expose it.

    If you really can’t live without filters in your template (though I can assure you, it is a good thing to separate all HTML template and code and it works once you are used to it), have a look at Scalate which may be used together with Lift as well.

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

Sidebar

Related Questions

This might seem like a stupid question I admit. But I'm in a small
This is a pretty simple question, and I searched the previous questions but couldn't
My question is a slight generalization of this one . For sake of discussion,
This is a generalization of the string contains substring problem to (more) arbitrary types.
This is a difficult and open-ended question I know, but I thought I'd throw
I'm trying to model a specialization/generalization, leaning towards using class table inheritance (see this
I have to make a decision regarding generalization vs polymorphism. Well the scenario is
I have a simple report sending framework that basically does the following things: It
I know about Association and Aggregation and Composition and Generalization what they are by
I have to do some work with Q Learning, about a guy that has

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.