Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

tocsoft/Umbraco-Razor-Components

Repository files navigation

Not been mainted for over 10 years and targets an unsupported version of unbraco before razor was a mjor thing being used on that platform.

Umbraco-Razor-Components

Helper extensions for razor support in Umbraco 4.x

This Library adds 2 new features to RazorLibraryCore (@Library.XXX())

##1. RenderMacro

RenderMacro has 2 modes;

First can be called using

@Library.RenderMacro("MacroAlias", new { Property1 = "value", Prop2= "value2"})

this will render a named macro from the back office.

Second can be called with a path to a razor macro script in the form

@Library.RenderMacro("~/macroScripts/scriptFile.cshtml", new { Property1 = "value", Prop2= "value2"})

this doesn't need to have been registered in the back office to work.

##2. ImageUrl/ImageUrls

This call can be used to retrieve a one or more crop urls form a media picker property (also supports DAMP and embedded media xml)

@Library.ImageUrl("imagePropertyAlias", "aliasOfCropPropertyOnMediaNode", "cropName")

this calls falls back to using the umbracoFile property if needs must.

##How to use

add @using Tocsoft.Umbraco.RazorComponents to the top of your razor file and you will then be able to use the helper methods.

##Compatibility

This is compatible with normal Umbraco Razor macros an also from within views using the UmbraMVCo library

About

Helper extensions for razor support in Umbraco 4.x

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published