0

Im using Umbraco 7 for an Intranet. I was hoping to replicate some functionality that is in the backend, ive noticed when it renders the macro in the backend it will load the macro after / during the full page load.

I was hoping to replicated that same functionality in the front end, so that it can load the full page quickly then render the macros as and when theyve fully rendered

Has anyone else done anything like this before?

Thanks Ian

Ian Bishop
  • 13
  • 3
  • what are you trying to do? front end renders macros. use `Umbraco.RenderMacro(string alias)` to render the macros – Chaitanya Gadkari Jul 06 '15 at 13:47
  • Currently in backend of Umbraco 7 when you load a page with Macros on it, it will load them all individually like iframes, So it makes you think the page is loading faster, i would like to replicate that in the front end. – Ian Bishop Jul 06 '15 at 16:14
  • If you have a slow macro, you need to improve the code, or use caching. for loading individually, use AJAX calls. http://www.w3schools.com/ajax/ – Jan Bluemink Jul 07 '15 at 07:05

1 Answers1

0

The reason it works like that in the back end of Umbraco is that the Macros are stored as custom markup in the RichText editor. There's some JS that looks for the code and then parses the macro details and loads in a representation of the markup into the editor.

If you want to copy the functionality of the back office, have a look at the source code for Umbraco and see if you can use the method that they use.

Tim
  • 4,167
  • 1
  • 13
  • 21
  • Hi Tim Thank you for your reply, it has been very helpful. I have replaced them as AJAX calls for now, i will investigate it further when i have time – Ian Bishop Aug 05 '15 at 08:05