Class ParagraphViewModel
- Namespace
- Dynamicweb.Frontend
- Assembly
- Dynamicweb.dll
ParagraphViewModel represents the rendering context used when a paragraph is rendered.
- Inheritance
-
Paragraph
View Model
- Inherited Members
Remarks
Contains rendering context information of the rendering Paragraph
Constructors
ParagraphViewModel()
Properties
ColorScheme
Gets the color scheme.
Property Value
- Color
Scheme View Model The color scheme as an Color
Scheme .View Model
Container
Gets the name of the content placeholder where this paragraph is located.
Property Value
- string
The name of the container, e.g. 'myContainer'.
Remarks
If the container does not exist in the layout currently being rendered, the paragraph is rendered to the default placeholder
ContainerCount
Gets the total count of paragraphs under the content placeholder where this paragraph is located.
Property Value
- int
A number indicating how many paragraphs are rendered in the container
- See Also
ContainerSettings
Gets the content placeholder settings. The settings from the layout template where this container is defined.
Property Value
- IDictionary<string, string>
The container settings as an IDictionary<TKey, TValue> where TKey and TValue are both string.
- See Also
ContainerSort
Gets the sort order of this paragraph under the current content placeholder.
Property Value
- int
A number starting from 1 that represents this paragraphs sort in the current content placeholder
Remarks
Can potentially be a negative integer.
- See Also
GridColumnNumber
Gets the position of this paragraph in the current grid row.
Property Value
- int
The grid column number, e.g. 2 (out of 3)
GridRowColumnCount
Gets the count of columns in the current grid row.
Property Value
- int
The number of grid row columns, e.g. 3
Header
Gets the header (name) of the paragraph.
Property Value
- string
The header or name e.g 'my paragraph name'.
ID
Property Value
- int
The paragraph id e.g. 1.
Image
Gets the relative path to the image selected or linked on the paragraph.
Property Value
- string
The path to the image, e.g. /Files/Images/Image.jpg or http://domain.com/image.jpg.
ImageAlt
Gets the alt-text of the image.
Property Value
- string
Any string, e.g. "image of a penguin with our yellow hat on".
ImageCaption
Gets the image caption.
Property Value
- string
The image caption e.g "Electric bike - EV1 Bike".
ImageFocalPositionFromLeft
Gets the focal points position from the left edge of the image in percentage.
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 (horizontal)
ImageFocalPositionFromTop
Gets the focal points position from the top edge of the image in percentage.
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)
ImageFocalX
Gets or sets the x axis focal point.
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
ImageFocalY
Gets or sets the y axis focal point.
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
ImageLink
Gets the link specified in the image settings.
Property Value
- string
The image link as an URL e.g. default.aspx?id=1 or /home or http://domain.com/about.
ImageLinkTarget
Gets the image link target associated to the Image
Property Value
- string
Standard, _blank, _top, _self.
ImagePath
Gets the absolute image path.
Property Value
- string
The absolute image path i.e. c:/website/Files/Images/View.jpg.
Item
If this paragraph has an item associated with it, this property gives you access to the item viewmodel which is used to access item content.
Property Value
- Item
View Model The Item-viewmodel or null.
ItemId
Gets the item id.
Property Value
- string
E.g. 5
- See Also
ItemType
Gets the item type system name.
Property Value
- string
E.g. 'myItemtype'
- See Also
ModuleSystemName
Gets the system name of the module (app) attached to the paragraph.
Property Value
- string
The system name of the module e.g. 'basicform' for forms module.
PageID
Gets the page id of the page the paragraph belongs to.
Property Value
- int
E.g. 1
Sort
Gets or sets the sort order of the paragraph.
Property Value
- int
An integer representing the sort order for displaying paragraph on the page it belongs.
Template
Gets the layout template selected for this paragraph. Not set if the template is not explicitly selected on the paragraph.
Property Value
- string
The name of the template e.g. "mytemplate.cshtml".
Text
Gets the default paragraph rich text field content.
Property Value
- string
The text e.g. "this is the paragraph text".
Methods
GetImageFocalPointParameters()
Returns a focal point parameter string for use with GetImage.ashx.
Returns
- string
If Image
Has is true, the return is a strings of the following structure "x=ImageFocal Point() FocalX &y=ImageFocalY " Otherwise the return is Empty.
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.
GetModuleOutput()
Returns the module (app) output of this paragraph if a module is attached. An instance of Content
Returns
- string
A string of html containing the rendering of the module. If no module is attached (Module
System is null) then an empty string is returnedName
Remarks
This method only executes the module once. If it is called more than once for each instance of a Paragraph
ImageHasFocalPoint()
Detects if the current image has at least one focal point set.
Returns
- bool
If one of Image
FocalX or ImageFocalY are non-zero the return value is true. If both are 0, the return value is false.