Hi Tom, how about using something like facebox to load your form and pass the 'current' page in the URL (then parse it in your control). You'd probably need to extend Contour to create a field that will read the URL var OR, you could use a standard text box and include in your display file some JS to populate by reading the query string.
Hmmm, here's a thought (maybe), how about you have a template that houses your contour form AND an XSLT macro that basically just does the following:
<xsl:variable name="pageId" select="umbraco.library:RequestQueryString('pageId')"/>
<xsl:variable name="pageUrl" select="umbraco.library:NiceUrl($pageId)"/>
<script type="text/javascript">
$(document).ready(function(){
//set the value of the textbox and include the page URL that we set above...
$('#idOfTextField').val('Hey! Check out this page:\n\n<xsl:value-of select="$pageUrl"/>');
});
</script>
Not tested this, but something like that should work (outside of creating a custom field using the contour API.
Tom, I suggest you use an alternate template for the contour form, instead of calling contour from a content page. That way you get the page ID of the original page in the record. Plain and simple.
However if you go with a separate contour node you can get the page id stored in it by using a custom workflow and update the record page id. You can send the page id in the query string, which you can access through the RecordEventsArg parameter
However I would definitely go for the alternate template approach as it requires no extra programming and it will save you a lot of EMailAFriend nodes.
Email to a friend
Hi i was trying to think up a plan of attack for an email to a friend piece of functionality that would appear in an overlay.
I was just wondering how I could make this happen in contour..
I was thinking have a node called EmailAFriend.aspx as a url on each page with a rel=overlay to bring it up in an overlay.
My problem is ill need some way of passing the current page url into a contour email somehow..
i was looking at per's xslt html email thing but am not sure how to proceed.
Thanks,
Tom
Hi Tom, how about using something like facebox to load your form and pass the 'current' page in the URL (then parse it in your control). You'd probably need to extend Contour to create a field that will read the URL var OR, you could use a standard text box and include in your display file some JS to populate by reading the query string.
HTH,
Nik
Hi Nik,
thanks so much for you reply..
We're using jQuery tools overlay it was mainly just the passing of the value into contour so i was thinking something like
http://domain.com/email-a-friend.aspx?page-id=1111
and then how to get page-id into the email via nice url..
would the bracket syntax work? like how can you retrieve query string values via the bracket syntax?
Hmmm, here's a thought (maybe), how about you have a template that houses your contour form AND an XSLT macro that basically just does the following:
Not tested this, but something like that should work (outside of creating a custom field using the contour API.
HTH,
Nik
Tom, I suggest you use an alternate template for the contour form, instead of calling contour from a content page. That way you get the page ID of the original page in the record. Plain and simple.
However if you go with a separate contour node you can get the page id stored in it by using a custom workflow and update the record page id. You can send the page id in the query string, which you can access through the RecordEventsArg parameter
record.UmbracoPageId = int.Parse(e.Context.Request.QueryString[pageId])
However I would definitely go for the alternate template approach as it requires no extra programming and it will save you a lot of EMailAFriend nodes.
how do i delete that previous post? is there a way i can? or can an admin please delete the xslt markup
Can someone please delete the 5/7/2010 7:33:36 AM post
Tom,
Post has been deleted as per your request.
Cheers,
/Dirk
is working on a reply...