Table of Contents

Class ParagraphViewModel

Namespace
Dynamicweb.Frontend
Assembly
Dynamicweb.dll
ParagraphViewModel represents the rendering context used when a paragraph is rendered.
public class ParagraphViewModel : ViewModelBase
Inheritance
ParagraphViewModel
Inherited Members

Remarks

Contains rendering context information of the rendering Paragraph

Constructors

ParagraphViewModel()

public ParagraphViewModel()
See Also

Properties

ColumnsClassLarge

Get the class string which defines the paragraph in the grid for large devices
public string ColumnsClassLarge { get; set; }

Property Value

string
See Also

ColumnsClassMedium

Get the class string which defines the paragraph in the grid for medium devices
public string ColumnsClassMedium { get; set; }

Property Value

string
See Also

ColumnsClassSmall

Get the class string which defines the paragraph in the grid for small devices
public string ColumnsClassSmall { get; set; }

Property Value

string
See Also

ColumnsLarge

Get the number of columns which defines the width of the paragraph for large devices
public int ColumnsLarge { get; set; }

Property Value

int
See Also

ColumnsMedium

Get the number of columns which defines the width of the paragraph for medium devices
public int ColumnsMedium { get; set; }

Property Value

int
See Also

ColumnsSmall

Get the number of columns which defines the width of the paragraph for small devices
public int ColumnsSmall { get; set; }

Property Value

int
See Also

Container

Gets or sets the layout container this paragraph should be rendered to. The paragraph container is defined in the layout template.
public string Container { get; set; }

Property Value

string
The name of the container.

Remarks

If the container does not exist in the layout currently being rendered, the paragraph is rendered to the default placeholder
See Also

ContainerCount

Gets the number of paragraphs being rendered in the current container.
public int ContainerCount { get; set; }

Property Value

int
A number indicating how many paragraphs are rendered in the container
See Also

ContainerSettings

Gets or sets the container settings.
public IDictionary<string, string> ContainerSettings { get; set; }

Property Value

IDictionary<string, string>
The container settings.
See Also

ContainerSort

Gets or sets the content placeholder sort value of the paragraph being rendered .
public int ContainerSort { get; set; }

Property Value

int
A number starting from 1 that represents this paragraphs sort in the current content placeholder
See Also

GlobalID

Gets the global id. If GlobalID is > 0 it means that this paragraph instance is a shortcut to another paragraph and that will be rendered instead.
public int GlobalID { get; set; }

Property Value

int
The global id.
See Also

Grid

Gets or sets the grid settings if the current paragraph is being rendered in a grid.
public GridSettings Grid { get; set; }

Property Value

GridSettings
The grid,
null
if not being rendered in a grid.
See Also

GridColumnNumber

Gets or sets the column position of this paragraph in the current grid row. If the paragraph is not in a grid, value cannot be used.
public int GridColumnNumber { get; set; }

Property Value

int
See Also

GridRowColumnCount

Gets or sets the number of columns in the current grid row that this paragraph is being rendered in. If the paragraph is not in a grid, value cannot be used.
public int GridRowColumnCount { get; set; }

Property Value

int
See Also

Header

Gets the header (name) of the paragraph.
public string Header { get; set; }

Property Value

string
The header or name.
See Also

ID

Gets the paragraph id.
public int ID { get; set; }

Property Value

int
The paragraph id.
See Also

Image

Gets the path to the image selected or linked on the paragraph.
public string Image { get; set; }

Property Value

string
The path to the image, i.e. /Files/Images/Image.jpg or http://domain.com/image.jpg.
See Also

ImageAlt

Gets the alt-text of the image.
public string ImageAlt { get; set; }

Property Value

string
The alternate image text.
See Also

ImageCaption

Gets the image caption.
public string ImageCaption { get; set; }

Property Value

string
The image caption.
See Also

ImageFocalPositionFromLeft

Gets the focal points position from the left edge of the image in percentage.
public int ImageFocalPositionFromLeft { get; }

Property Value

int
A number between 0 and 100 that tells in percent how far from the left of the image the focal point is on the x-axis (horistontal)
See Also

ImageFocalPositionFromTop

Gets the focal points position from the top edge of the image in percentage.
public int ImageFocalPositionFromTop { get; }

Property Value

int
A number between 0 and 100 that tells in percent how far from the top of the image the focal point is on the y-axis (vertical)
See Also

ImageFocalX

Gets or sets the x axis focal point.
public int ImageFocalX { get; set; }

Property Value

int
A number between -100 and 100 that tells in percent how far from the middle of the image the focal point is on the x-axis

Remarks

Negative numbers are left of the middle, positive right of the middle
See Also

ImageFocalY

Gets or sets the y axis focal point.
public int ImageFocalY { get; set; }

Property Value

int
A number between -100 and 100 that tells in percent how far from the middle of the image the focal point is on the y-axis

Remarks

Negative numbers are below the middle, positive above the middle
See Also

ImageHAlign

Gets the image horisontal align.
public string ImageHAlign { get; set; }

Property Value

string
The image horisontal align.
See Also

ImageHeight

Gets the height of the image in pixels.
public int ImageHeight { get; }

Property Value

int
The height of the image. Returns 0 if no image is set.
See Also
Gets the link on the image.
public string ImageLink { get; set; }

Property Value

string
The image link.
See Also

ImageLinkTarget

Gets the image link target.
public string ImageLinkTarget { get; set; }

Property Value

string
The image link target.
See Also

ImagePath

Gets or sets the relative image path.
public string ImagePath { get; set; }

Property Value

string
The absolute image path i.e. c:/website/Files/Images/View.jpg.
See Also

ImageVAlign

Gets the image vertical align.
public string ImageVAlign { get; set; }

Property Value

string
The image vertical align.
See Also

ImageWidth

Gets the width of the image in pixels.
public int ImageWidth { get; }

Property Value

int
The width of the image. Returns 0 if no image is set.
See Also

IsFrontendEditEnabled

Gets or sets a value indicating whether the frontend is being rendered in edit state.
[Obsolete("Do not use. Frontend editiong has been replaced by Visual Editor in the administation.")]
public bool IsFrontendEditEnabled { get; set; }

Property Value

bool
true if frontend editing is enabled, otherwise, false.
See Also

IsGrid

Gets or sets a value indicating whether this instance is being rendered in a grid.
public bool IsGrid { get; set; }

Property Value

bool
true if this instance is being rendered in a grid; otherwise, false.
See Also

IsLastParagraph

Indicates the current paragraph is the last in the list
public bool IsLastParagraph { get; set; }

Property Value

bool
See Also

IsNewGridRow

Indicates the current paragraph is the first in a new row in the grid
public bool IsNewGridRow { get; set; }

Property Value

bool
See Also

Item

Gets or sets the item.
public ItemViewModel Item { get; set; }

Property Value

ItemViewModel
The item.
See Also

ItemId

Gets the id of the related item record.
public string ItemId { get; set; }

Property Value

string
The item id. Returns string.empty if the paragraphs is not an item
See Also

ItemType

Gets the itemtype of the paragraph.
public string ItemType { get; set; }

Property Value

string
The item systemname. Returns string.empty if the paragraphs is not an item
See Also

ModuleSystemName

Gets or sets the name of the module system name attached to the paragraph.
public string ModuleSystemName { get; set; }

Property Value

string
The systemname of the module.
See Also

PageID

Gets the page id.
public int PageID { get; set; }

Property Value

int
The page id of the page the paragraph belongs to.
See Also

SwitchRowAfterCurrentParagraph

Indicates if the grid will switch row after this paragraph is added
public bool SwitchRowAfterCurrentParagraph { get; set; }

Property Value

bool
See Also

SwitchRowAfterNextParagraph

Indicates if the grid will switch row after the next paragraph is added
public bool SwitchRowAfterNextParagraph { get; set; }

Property Value

bool
See Also

Template

Gets the paragraph template used for rendering.
public string Template { get; set; }

Property Value

string
The name of the template.
See Also

Text

Gets the text.
public string Text { get; set; }

Property Value

string
The text.
See Also

Methods

GetImageFocalPointParameters()

Returns a focal point parameter string for use with GetImage.ashx.
public string GetImageFocalPointParameters()

Returns

string

Remarks

Returns focal point in the format: x=75&y=23 If focal points are not defined (if they are both 0) this method returns an empty string.
See Also

GetModuleOutput()

Gets the module output of this paragraph if a module is attached. An instance of ContentModule is created matching the name of the ModuleSystemName on the name of the AddInNameAttribute on the class.
public string GetModuleOutput()

Returns

string
A string of html containing the rendering of the module. If no module is attached (ModuleSystemName is null) then an empty string is returned

Remarks

This method only executes the module once. If it is called more than once for each instance of a ParagraphViewModel, the result of the first call is returned.
See Also

ImageHasFocalPoint()

Detects if the current image has at least one focal point set.
public bool ImageHasFocalPoint()

Returns

bool
See Also

SetModuleFactory(Func<string>)

Initializes a new instance of the ParagraphViewModel class.
public void SetModuleFactory(Func<string> moduleOutputFactory)

Parameters

moduleOutputFactory Func<string>
See Also

See Also

To top