Parses HTML and replaces with PHP based on cybdata and cybkey attributes.
cybkey attributes are used to identify the name/key of the data source:
ex: cybkey="Name of Input"
output: <?= $DATA['Name of Input'] ?>
cybdata attributes are used to identify the type of data being replaced
(Only one cybdata attribute can be added per element)
Types of cybdata attributes:
text / html
Replaces text / inner html.
textarea
Replaces text and uses nl2br(); to convert new lines into line breaks
previewtext
Similar to textarea, but if no value is set it will pull from the html field.
Add a numeric value to set amount of characters pulled from the html field. Ex: previewtext200 If no value is set, the default is 200.
If an html field does not already exist, this will automatically add an html field to the AMSD Table SQL data.
url
Replaces href attribute
profileurl
Adds a standard url field, but if no url is set, it links to the profile page
href="<?= isset($ITEM->url) ? $ITEM->url : amsdProfileSlug($page, $amsd, $ITEM) ?>"
If an html field does not already exist, this will automatically add an html field to the AMSD Table SQL data.
icon
Replaces all html within element with:
<i class="<?= $ITEM->cybkey ?>"</i>
img
(Standard Image)
Replaces src attribute
Add a numeric value to set size of image pulled
Ex: cybdata="img1000" pulls image using /1000
Numeric values should be divisible by 100
If no numeric value is added the default is 1000px
bg
(Background Image or focused_img)
Replaces style attribute
Add a numeric value to set size of image pulled
Ex: cybdata="bg2000" pulls image using /2000
Numeric values should be divisible by 100
If no numeric value is added the default is 2000px
list
sorted_list or amsd within amsd
Wraps first child element with a loop, removes remaining child elements
Loop format:
<? foreach(json_decode($DATA['cybkey'] ) as $k => $cybkey_ITEM) { ?>
amsd
Wraps first child element with a standard AMSD loop, removes remaining child elements
Loop format:
<? foreach($amsd["data"] as $k => $ITEM) { ?>
block
Define a block for the block builder data. The cybkey value gets used as the block title and template name. If no cybkey is set, it will use the first class name.
Defaults to a strings block unless an AMSD loop exists. If a child element with cybdata="amsd" exists, then it will be considered an AMSD block.
Any child elements with cybdata that are outsdie of the AMSD loop with get added onto the AMSD block as "Additional Settings".
phone
Replaces text, and adds href attribute with tel:+1
Replaces text, and adds href attribute with mailto:
button
Replaces text and href attributes. If a child element has cybdata="buttontext" then the button's text will be placed inside of that element instead.
buttontext
Replaces text, only works if a parent element also has cybdata set to button.
Use if the button's text needs to be wrapped with a span or another div inside of the button. If not used, the button's text will sit directly inside the button element.
date
Replaces text with date format: "F j, Y"
time
Replaces text with time format: "g:ia"
nav
Replaces element with: <? printWebflowMenu(); ?>
logo
Replaces element with a logo-home-link including a logo-image (and logo-scrolled if present):
<a href="/home" class="logo-home-link w-nav-brand" title="Home"><img src="/image/<?= $DEV_CONFIG['Logo'] ?>/600" alt="<?= $owner->site_title ?>" class="logo-image"><img src="/image/<?= $DEV_CONFIG['Logo on Scroll'] ?>/600" alt="<?= $owner->site_title ?>" class="logo-scrolled"></a>
footerlogo
Replaces element with a footer-logo-link-block including a footer-logo image.
<a href="/home" class="footer-logo-link-block w-inline-block" title="Home"><img src="/image/<?= $DEV_CONFIG['Logo in Footer'] ?>/600" alt="<?= $owner->site_title ?>" class="footer-logo"></a>
alertbar
Replaces element with:
<? printBlock(ALERT_BAR_BLOCK_ID); ?>
popup
Replaces element with:
<? printBlock(POPUP_BLOCK_ID); ?>
videobg
Replaces element with a background video. The expected input value is the full video URL of either a vimeo or youtube video
The php snippet includes a parseVideo() function which detects if the video URL is from vimeo or youtube
The background video structure includes an iframe inside of 3 nested divs in order to get the responsive css to work correctly
The div structure looks like this:
<div class="video-background-wrapper-outer">
<div class="video-background-wrapper-inner">
<div class="video-background">
<iframe class="cms-video-vimeo"></iframe>
</div></div></div>
tag
Replaces element with a Cybernautic tag
profile
Use $ITEM instead of $DATA for all child elements with cybdata
common
Use $COMMON_ITEMS instead of $DATA for all child elements with cybdata
ifisset
Wraps the element in an if statement, ex:
<div class="image-wrapper" cybdata="ifisset" cybkey="Image"></div>
<? if(isset($DATA['Image'])) { ?><div class="image-wrapper"></div><? } ?>
style
Checkes for any <style> tags and compiles any CSS for use in /assets/scss/custom_styles.scss
script
Checkes for any <script> tags and compiles any JS for use in /assets/js/scripts.js
pagebanner
Removes style attribute and adds <?= $interiorBannerStyles ?>
pagetitle
Replaces contents with <?= $titleText ?>
and wraps element with <? if(isset($titleText)) { ?> <? } ?>
pagesubtitle
Replaces contents with
<?= $subtitleText?> and wraps element with <? if(isset($subtitleText)) { ?> <? } ?>
breadcrumbs
Replaces element with
<? include(FRONTEND . "/partials/breadcrumbs.php"); ?>
inner
Flags output for use in inner.php
printblocks
Replaces contents with
<? include(FRONTEND . "/partials/print-blocks.php"); ?>
Conents will still be parsed over for any child elements with cybdata
header
Use $COMMON_ITEMS instead of $DATA for all child elements with cybdata
Flags output for use in /partials/header-content.php
footer
Use $COMMON_ITEMS instead of $DATA for all child elements with cybdata
Flags output for use in /partials/footer-content.php
preloader
Replaces element with
<? include(FRONTEND . "/partials/preloader.php"); ?>
Also flags output for use in /partials/preloader.php
ignore
The element and it's contents will be skipped from parsing. It will still be included in the PHP output, but without any parsed PHP.
textstyles
Build Custom Styles Menu JSON config based on child elements that contain cybkey attributes. Titles will be pulled from child element's cybkey.