Converts Webflow exports into Cybernautic ready sites 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:
<?= fa_icon($DATA['Key']) ?>
Adds arguments to get correct icon styling: ex. <?= fa_icon($DATA['Key'], 'regular', 'duotone') ?>
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_WITH_UNDERSCORE_ITEM) { ?>
If the first two child elements have differing CSS classes, adds if/else logic on the class attribute for odd/even items.
Add a numeric value to set an item limit
Ex: cybdata="list2" adds "limit" => 2 to the sorted list field builder data
amsd
Wraps first child element with a standard AMSD loop, removes remaining child elements
Loop format:
<? foreach($amsd["data"] as $k => $ITEM) { ?>
If the first two child elements have differing CSS classes, adds if/else logic on the class attribute for odd/even items.
Add a numeric value to set an item limit
Ex: cybdata="amsd2" adds block setting "AMSD Limit" => 2
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.
buttonicon
Replaces icon, 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(); ?>
secondarynav
Replaces element with: <? include(FRONTEND . "/partials/secondary-nav.php"); ?>
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><? } ?>
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
inner
Flags output for use in inner.php
pagebanner
Removes style attribute and adds <?= $interiorBannerStyles ?>
pagetitle
Replaces contents with <?= $interiorBannerTitle ?>
and wraps element with <? if(isset($interiorBannerTitle)) { ?> <? } ?>
pagesubtitle
Replaces contents with
<?= $interiorBannerSubtitle?> and wraps element with <? if(isset($interiorBannerSubtitle)) { ?> <? } ?>
breadcrumbs
Replaces element with
<? include(FRONTEND . "/partials/breadcrumbs.php"); ?>
printblocks
Replaces contents with
<? include(FRONTEND . "/partials/print-blocks.php"); ?>
Conents will still be parsed over for any child elements with cybdata
textstyles
Build Custom Styles Menu JSON config based on child elements that contain cybkey attributes. Titles will be pulled from child element's cybkey.
Add a numeric value to set Wrapper Width in Developer Settings.
Ex: If text content is 900px wide, use cybdata="textstyles900" which then updates the Wrapper Width to 1022px (122 is added to the value because that represents the amount of padding and borders).
preloader
Replaces element with
<? include(FRONTEND . "/partials/preloader.php"); ?>
Also flags output for use in /partials/preloader.php
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
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.
search
Converts contents into a functional search form.
Strips Webflow-specific classes (w-form, w-embed) and attributes (id, name, data-name, data-wf-page-id, data-wf-element-id) from the element and all descendants.
Removes elements with class w-form-done and w-form-fail.
Sets action="/search" on the <form> element (replacing any existing method/action attributes) and name="query" id="search" on the first <input> element.
sitemap
Marker for a static "sitemap" link to keep as-is at the end of a cybdata="list" (so that sitemap link can be hardcoded inside of a footer links area)