Class PublishingBuiltIn
Inherited Members
Namespace: PnP.Framework.Modernization.Publishing
Assembly: PnP.Framework.dll
Syntax
public class PublishingBuiltIn : FunctionsBase
Constructors
PublishingBuiltIn(BaseTransformationInformation, ClientContext, ClientContext, IList<ILogObserver>)
Instantiates the base builtin function library
Declaration
public PublishingBuiltIn(BaseTransformationInformation baseTransformationInformation, ClientContext sourceClientContext, ClientContext targetClientContext, IList<ILogObserver> logObservers = null)
Parameters
|
BaseTransformationInformation
baseTransformationInformation
Page transformation information |
|
ClientContext
sourceClientContext
The ClientContext for the source |
|
ClientContext
targetClientContext
|
|
IList<ILogObserver>
logObservers
|
Methods
DefaultTaxonomyFieldValue(String, String, String)
Populate a taxonomy field based upon provided term id's. You can configure to optionally overwrite existing values
Declaration
public string DefaultTaxonomyFieldValue(string fieldValue, string termIdString, string overwriteString)
Parameters
|
System.String
fieldValue
List of term id's to set, multiple values can also be used when the taxonomy field is configured to accept multiple terms |
|
System.String
termIdString
Static bool ('true', 'false') to indicate if the default term values have to be set in case the fiels already contains terms |
|
System.String
overwriteString
String with term information needed to set the taxonomy field |
Returns
|
System.String
|
EmptyString()
Returns an empty string
Declaration
public string EmptyString()
Returns
|
System.String
Empty string |
Prefix(String, String, String)
Prefixes a string
Declaration
public string Prefix(string prefix, string content, string applyIfContentIsEmpty)
Parameters
|
System.String
prefix
Prefix to be applied |
|
System.String
content
Value to apply the prefix to |
|
System.String
applyIfContentIsEmpty
Apply prefix also when the content field is empty |
Returns
|
System.String
Prefixed string |
PrefixAndSuffix(String, String, String, String)
Prefixes and suffixes a string
Declaration
public string PrefixAndSuffix(string prefix, string suffix, string content, string applyIfContentIsEmpty)
Parameters
|
System.String
prefix
Prefix to be applied |
|
System.String
suffix
Suffix to be applied |
|
System.String
content
Value to apply the prefix/suffix to |
|
System.String
applyIfContentIsEmpty
Apply prefix/suffix also when the content field is empty |
Returns
|
System.String
Prefixed string |
StaticString(String)
Returns an the (static) string provided as input
Declaration
public string StaticString(string staticString)
Parameters
|
System.String
staticString
Static string that will be returned |
Returns
|
System.String
String provided as input |
Suffix(String, String, String)
Suffixes a string
Declaration
public string Suffix(string suffix, string content, string applyIfContentIsEmpty)
Parameters
|
System.String
suffix
Suffix to be applied |
|
System.String
content
Value to apply the suffix to |
|
System.String
applyIfContentIsEmpty
Apply suffix also when the content field is empty |
Returns
|
System.String
Prefixed string |
ToAuthors(String)
Looks up user information for passed user id
Declaration
public string ToAuthors(string userId)
Parameters
|
System.String
userId
The id (int) of a user |
Returns
|
System.String
A formatted json blob describing the user's details |
ToImageAltText(String)
Returns the image alternate text of a Publishing Image field value.
Declaration
public string ToImageAltText(string htmlImage)
Parameters
|
System.String
htmlImage
PublishingPageImage |
Returns
|
System.String
Image alternate text |
ToImageAnchor(String)
Returns the image anchor url of a Publishing Image field value
Declaration
public string ToImageAnchor(string htmlImage)
Parameters
|
System.String
htmlImage
Publishing Image field value |
Returns
|
System.String
Image anchor url |
ToImageCaption(String)
Returns the image caption of a Publishing Html image caption field
Declaration
public string ToImageCaption(string htmlField)
Parameters
|
System.String
htmlField
Publishing Html image caption field value |
Returns
|
System.String
Image caption |
ToImageUrl(String)
Returns the server relative image url of a Publishing Image field value
Declaration
public string ToImageUrl(string htmlImage)
Parameters
|
System.String
htmlImage
Publishing Image field value |
Returns
|
System.String
Server relative image url |
ToPreviewImageUrl(String)
Returns a page preview image url
Declaration
public string ToPreviewImageUrl(string image)
Parameters
|
System.String
image
A publishing image field value or a string containing a server relative image path |
Returns
|
System.String
A formatted preview image url |