Class CPLayoutBaseClass
- Namespace
- Contensive.BaseClasses
- Assembly
- CPBase.dll
Manage layout records
public abstract class CPLayoutBaseClass
- Inheritance
-
CPLayoutBaseClass
- Inherited Members
Methods
GetLayout(int)
get the layout by its id. If not found, returns blank. To determine record status use Layout Model instead.
public abstract string GetLayout(int layoutId)
Parameters
layoutIdint
Returns
GetLayout(string)
get the layout by its guid. If not found, returns blank. To determine record status use Layout Model instead.
public abstract string GetLayout(string layoutGuid)
Parameters
layoutGuidstring
Returns
GetLayout(string, string, string)
Returns a layout by Guid. If missing, the layout record is created with the default name and the layout file is transformed (data attribute based html transformations). Layout files are read from privateFiles first; if not found there, cdnFiles is used as a fallback.
public abstract string GetLayout(string layoutGuid, string defaultLayoutName, string defaultLayoutFilename)
Parameters
layoutGuidstringThe guid that uniquely identifies the layout record.
defaultLayoutNamestringThe name to assign to the layout record if it must be created.
defaultLayoutFilenamestringThe filename (may include a path) of the default html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
Returns
- string
The html layout content appropriate for the current platform version.
GetLayout(string, string, string, string)
Returns a layout by Guid. If missing, the layout record is created with the default name and layouts. The default layout is used when platform5 is not appropriate (platform not set, set to 4, platform5 layout is blank). The platform5 layout is used for platform5 (sites set to bootstrap 5 platform). Layout files are read from privateFiles first; if not found there, cdnFiles is used as a fallback.
public abstract string GetLayout(string layoutGuid, string defaultLayoutName, string defaultLayoutFilename, string platform5LayoutFilename)
Parameters
layoutGuidstringThe guid that uniquely identifies the layout record.
defaultLayoutNamestringThe name to assign to the layout record if it must be created.
defaultLayoutFilenamestringThe filename (may include a path) of the default html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
platform5LayoutFilenamestringThe filename (may include a path) of the platform 5 (Bootstrap 5) html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
Returns
- string
The html layout content appropriate for the current platform version.
GetLayoutByName(string)
Returns the html layout field of a layout record
public abstract string GetLayoutByName(string layoutName)
Parameters
layoutNamestring
Returns
GetLayoutByName(string, string)
Returns the html layout field of a layout record. If the record does not exist, it is created with the supplied default layout
public abstract string GetLayoutByName(string layoutName, string defaultLayout)
Parameters
Returns
Transform(string)
Transform the input html using the data attribute based html transformations. These transformations are typically used to convert a static html design
data-mustache-section data-mustache-inverted-section data-body data-layout data-href data-value data-src data-alt data-addon data-innertext data-delete data-mustache-value data-mustache-variable
public abstract string Transform(string sourceHtml)
Parameters
sourceHtmlstring
Returns
processImportFile(string, ImporttypeEnum, int, int, int, int, ref List<string>)
Import a file and process the html. Save the result.
public abstract bool processImportFile(string htmlSourceTempPathFilename, CPLayoutBaseClass.ImporttypeEnum importTypeId, int layoutId, int pageTemplateId, int emailTemplateId, int emailId, ref List<string> userMessageList)
Parameters
htmlSourceTempPathFilenamestringimportTypeIdCPLayoutBaseClass.ImporttypeEnumlayoutIdintIf not 0, the imported html will be saved to the record in this table.
pageTemplateIdintIf not 0, the imported html will be saved to the record in this table.
emailTemplateIdintIf not 0, the imported html will be saved to the record in this table.
emailIdintIf not 0, the imported html will be saved to the record in this table.
userMessageListList<string>If there were any processing errors caused by the data, return them here. These can be presented to the user.
Returns
processImportFile(string, ImporttypeEnum, int, int, int, int, ref List<string>, int)
Import a file and process the html. Save the result.
public abstract bool processImportFile(string htmlSourceTempPathFilename, CPLayoutBaseClass.ImporttypeEnum importTypeId, int layoutId, int pageTemplateId, int emailTemplateId, int emailId, ref List<string> userMessageList, int layoutFrameworkId)
Parameters
htmlSourceTempPathFilenamestringimportTypeIdCPLayoutBaseClass.ImporttypeEnumlayoutIdintIf not 0, the imported html will be saved to the record in this table.
pageTemplateIdintIf not 0, the imported html will be saved to the record in this table.
emailTemplateIdintIf not 0, the imported html will be saved to the record in this table.
emailIdintIf not 0, the imported html will be saved to the record in this table.
userMessageListList<string>If there were any processing errors caused by the data, return them here. These can be presented to the user.
layoutFrameworkIdintif 5, import layout as framework 5, else default
Returns
updateLayout(string, int, string, string)
The layout record is created or updated with the default name and layout record. Layout files are read from privateFiles first; if not found there, cdnFiles is used as a fallback.
public abstract void updateLayout(string layoutGuid, int layoutContentId, string defaultLayoutName, string defaultLayoutFilename)
Parameters
layoutGuidstringThe guid that uniquely identifies the layout record.
layoutContentIdintSet to a contentid if this layout should be created in a different segment of Layouts, like 'layouts for CTA'. Use cp.content.getid("layouts for CTA") to determine the contentId.
defaultLayoutNamestringThe name to assign to the layout record if it must be created.
defaultLayoutFilenamestringThe filename (may include a path) of the default html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
updateLayout(string, int, string, string, string)
The layout record is created or updated with the default name and layout record. Layout files are read from privateFiles first; if not found there, cdnFiles is used as a fallback.
public abstract void updateLayout(string layoutGuid, int layoutContentId, string defaultLayoutName, string defaultLayoutFilename, string platform5LayoutFilename)
Parameters
layoutGuidstringThe guid that uniquely identifies the layout record.
layoutContentIdintSet to a contentid if this layout should be created in a different segment of Layouts, like 'layouts for CTA'. Use cp.content.getid("layouts for CTA") to determine the contentId.
defaultLayoutNamestringThe name to assign to the layout record if it must be created.
defaultLayoutFilenamestringThe filename (may include a path) of the default html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
platform5LayoutFilenamestringThe filename (may include a path) of the platform 5 (Bootstrap 5) html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
updateLayout(string, string, string)
The layout record is created or updated with the default name and layout record. Layout files are read from privateFiles first; if not found there, cdnFiles is used as a fallback.
public abstract void updateLayout(string layoutGuid, string defaultLayoutName, string defaultLayoutFilename)
Parameters
layoutGuidstringThe guid that uniquely identifies the layout record.
defaultLayoutNamestringThe name to assign to the layout record if it must be created.
defaultLayoutFilenamestringThe filename (may include a path) of the default html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
updateLayout(string, string, string, string)
The layout record is created or updated with the default name and layout record. Layout files are read from privateFiles first; if not found there, cdnFiles is used as a fallback.
public abstract void updateLayout(string layoutGuid, string defaultLayoutName, string defaultLayoutFilename, string platform5LayoutFilename)
Parameters
layoutGuidstringThe guid that uniquely identifies the layout record.
defaultLayoutNamestringThe name to assign to the layout record if it must be created.
defaultLayoutFilenamestringThe filename (may include a path) of the default html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.
platform5LayoutFilenamestringThe filename (may include a path) of the platform 5 (Bootstrap 5) html layout file. The filename-only portion is used to read from privateFiles; the full value is used to read from cdnFiles as fallback.