[Ur] Building site templates

James Parker jp at jamesparker.me
Tue Dec 6 01:46:40 EST 2011


Hi

I'm attempting to build a template for my site by passing the page content as a parameter to a function. Here is the call to the function:

sidebar <- return <xml><div>content!!</div></xml>;
Common.template (Some "test") sidebar

and the function body is something like:

fun template title sidebar =
        title' <- return (case title of
                | None => "UMDTalks"
                | Some t => String.append t " - UMDTalks"
        );
        return <xml>
		<html>
		…
		{sidebar}
		</html>
	</xml>


My current function signature is:

val template : option string -> xml -> transaction page

I believe the problem is in the signature. I guess what is the proper type for the second parameter?

Thanks,

JP

PS. The error I'm getting is:

common.urs:4:32-4:35: Wrong kind


More information about the Ur mailing list