Search Results
Your search for Macro returned 11 results. This is page 1 of 2
-
Poll Macro needs improving
A while back I posted a Poll macro for Umbraco. There was a reasonable amount of interest, so I posted the source. As the original post says, this was just a very quick demo and I thought that the method of storing responses would need improving. Niels posted a link to the demo on the Umbraco site and as a result it got several hundred responses which slows down Umbraco when trying to acess the node where the responses are stored in the GUI. This post is just to advise against using this Macro on production systems until I (or someone else) get the chance to improve it. -
Typed access to Umbraco Marco parameters in Partial Views
In an Umbraco PartialViewMacroPage any Macro parameters are typed as: IDictionary<string, object> This makes for some rather messy code when trying to retrieve these parameters. Consider a Partial View Macro that takes two parameters: Date - any date Days - a number of days to subtract from the date The purpose of this Macro is going to be to output the following using Razor: @days days before @date.ToString("dd MMM") ago it was @date.Subtract(TimeSpan.FromDays(days)).ToString("dd MMM") You'd register the parameters above with Umbraco and render the Macro as follows. @Umbraco.RenderMacro("DaysFromDate", new { days = 10, date = "2014/01/01" }) Note: one could pass the date parameter as a DateTime rather than a string -
A Simple Umbraco cart with Doc Cart, Contour and Bill4u
format: Install Doc Cart. Add SKU and Price properties to the product document type. Add the [DocCart] Cart Count (Razor) Macro to the master template. Display the price on the Umbraco product template Insert the [DocCart] Add to Cart Macro on the product template. Add the [DocCart] View Cart (AJAX) Macro to the cart page. Finally, a reminder of how the Add to cart Macro parameters end up looking: <umbraco:Macro UmbracoDocumentId="[#pageID -
A poll macro for Umbraco
A web poll is a useful way of gathering opinions from your site users. It is also one of the most trivial pieces of web functionality that you could write.A friend who is a java developer and has never really used .net or Umbraco wanted to see a real world example, so I put this together for him real quick (he was impressed).http://darren-fergusoncom.site.securepod.com/development/polldemo.aspxI’ll look at releasing a package at some point. It is implemented as a Macro that takes a question and a delimited set of answers as parameters. -
Poll macro source
I've had a few requests for the Poll macro source to be released. I am very busy at the moment, so I am just posting the ascx and associated c# for now. Those of you who wanted a complete package will have to wait a week or so I am afraid. A couple of things: - If you modify my code, please send me your changes with an explanation so that I can incorporate any new features/enhancements into my source controlled version. - If you find any bugs and are unable to fix them, please drop me an e-mail. - If you use the Poll on a for profit site please consider making a donation using the link at the bottom of the right hand navigation. To get you started here is how the Macro tag looks for the demo <?UMBRACO_MACRO macroAlias -
Simple PDF generation from Umbraco with Razor or XSLT
The screencast below demonstrates PDF Creator for Umbraco 2.0. I've dropped the XSL prefix from the package title as you can now use the templating language of your choice to output PDF. This tool does not mimic your HTML layouts in PDF format but allows you to define rich, unrestricted layouts suitable for printing using FO. PDF files are created as Umbraco templates PDFs are created using your templating language of choice, Razor, XSLT or your favourite. Easily embed Fonts, Images and SVG. PDF Creator is a commercial package. New features in version 2: No custom Macro required - just use standard Umbraco templates to output FO. Use Razor and other template languages. Force -
RSS feed aggregation using Yahoo pipes
RSS output to your Umbraco web server, possibly using some kind of Macro, but I'd recommend using a scheduled task and simply writing the feed to the file system as pipes with multiple feeds may impair your page load time - if for example one -
Perl for Umbraco
created an HTTP filter using C# that parses Umbraco pages and uses regular expressions to find PERL_MACRO tags – see the examples. The Marco named in the tag is modified to have a .plex extension and a request is made to http://yourhost.com/plex/macro.plex. Any other Macro params are forwarded as request parameters meaning you can pass values from Umbraco to Perl. To set up I simply add /plex to my Umbraco reserved paths in web.config and add an HTTP filter. If you’d like to play -
Displaying muiple points on a google map using my Umbraco datatype
A while back I wrote about displaying maps on your Umbraco website using my Google maps datatype for Umbraco. Since then I've had a number of requests to provide an example of how to display multiple points on a map and Matt Perry and I have finally come up with such an example. The first step is to write a simple XSLT macro that will list out all of the points that you want to show. I'm not going to give that example here, but the output should look similar to the following: <h1>Service stations in Lancashire</h1> <p>The following data is a list of latitude and longtitude points and a description for service stations in Lancashire</p> <div id="map"></div> <!-- Rendered from -
Unobtrusive AJAX blog comments for Umbraco
a postback to the comments form. Second, my Umbraco macro to display the comments seems to get run before the new comment is created in Umbraco so you have to refresh to view your new comment - again only when JavaScript is disabled.I'd like to add