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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:01:37+00:00 2026-06-05T01:01:37+00:00

For reusability, I want to re-use a widget inside another. For instance, the widget

  • 0

For reusability, I want to re-use a widget inside another. For instance, the widget file blogpost.hamlet could contain how a post is displayed, and blog.hamlet could contain the full blog.

The following content of blog.hamlet does not work:

$forall post <- posts
    ^{widgetFile "blogpost")

So, what is the correct syntax to embed one widget inside another?

  • 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-05T01:01:39+00:00Added an answer on June 5, 2026 at 1:01 am

    The Hamlet syntax does not support embedding Template Haskell splices inside of it, which makes the code you’re looking to do impossible. Instead, you need to create a helper function in Haskell, e.g.:

    blogpost post = $(widgetFile "blogpost")
    

    Then in blog.hamlet, you can have:

    $forall post <- posts
        ^{blogpost post}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to CSS principles when we want to implement reusability of styles we should
What should be more appropriate to use when you want to initialize class properties
I want to make '==' operator use approximate comparison in my program: float values
I want to use a for loop to print every date between 2 dates.
I want to use WCF + net.MSMQ, I am not interested in Azure Service
Can anyone give me a good reason why I would want to use XML
I want to determine the following QoS Attribute of my service: Response Time Reliability
I want to build a Python function that calculates, and would like to name
I want to switch from Java to a scripting language for the Math based
What's the best structure to use when designing a form/ details view for maximum

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.