Documentation

Documentation

  • Documentation
  • Externable.com

›Templates

Introduction

  • Introduction to Externable

Setup

  • Registration
  • Creating Subscription
  • Renaming subscription
  • Setup URL
  • Connecting Dynamics
  • Setting up email
  • Provisioning instance
  • Starting and stopping instance
  • Connecting Custom Domain
  • Upgrading
  • Taking Backups
  • Restoring Backups
  • Resetting Instance
  • Changing Billing Address
  • Changing Subscription Plan

Portal Backoffice Basics

  • Login To Backoffice
  • Navigation In Backoffice
  • Adding & Managing Users

Creating Content

  • Creating, Saving and Publishing Content
  • Scheduling Posts
  • Content Versioning
  • Creating Content Templates
  • Restricting Access To Content
  • Creating Media
  • Sensitive Data
  • RichText Editor
  • Content Tree

Dynamics Integration

  • Default Template
  • Presenting Dynamics Data

    • Creating Dynamics Integrated Content
    • Extracting Dynamics Query

    Dynamics Forms

    • How Forms Work
    • Working with Formulas
    • Example - Create a Form

Languages

  • Enabling Languages
  • Creating Translations

Members

  • Creating Members In The Frontend
  • Creating Members in the Backend
  • Linking Members To Dynamics Contacts

Portal extension

  • Document Types
  • Data Types
  • Property Editors
  • Grid Editors
  • Macros
  • Relation Types
  • LogViewer
  • Templates

    • Templates
    • Razor Syntax
    • Rendering Content
    • Rendering Media
    • Rendering CSS & JS
    • Partial Views
    • Partial Macro Views
  • CSS customizations
  • JavaScript
  • Plugins Development

    • Plugins Development
    • MVC Controllers
    • WebAPI Controllers

Notes

  • Open Source Used

Partial Macro Views

Partial view macros are the way to render the macro component in the end user UI - it is build following same princples as other templates and partial views with some additional features. They are the best ay to create dynamically repeatitive rendered components in your portal

View/Model Type

All partial view macro views inherit from Umbraco.Web.Macros.PartialViewMacroPage and as such, the header of each partial view macro file will have this syntax:

@inherits Umbraco.Web.Macros.PartialViewMacroPage

The model type for a partial view macro is Umbraco.Web.Models.PartialViewMacroModel which contains all of the properties you will need to render out content as well as some additional properties about the macro itself: MacroName, MacroAlias, MacroId, and MacroParameters.

Accessing content

The syntax in Partial View Macros is 100% on par with the Templates syntax, in fact they are driven by the exact same engine as MVC Views.

You can use @CurrentPage, @Model.Content, ...

Accessing macro parameters

You can access the macro's parameters using the MacroParameters property on the model which is of type IDictionary<string, object>

var myParam = Model.MacroParameters["aliasOfTheMacroParameter"];

or via the typed GetParameterValue method in Umbraco.Web.Models namespace

var myParam = Model.GetParameterValue<string>("aliasOfTheMacroParameter");

and with default value fallback

var myParam = Model.GetParameterValue<string>("aliasOfTheMacroParameter", "default value if parameter value has not been set");
← Partial ViewsCSS customizations →
  • View/Model Type
  • Accessing content
  • Accessing macro parameters
Copyright © 2021