cybflow

Parses HTML and replaces with PHP based on cybdata and cybkey attributes.

Chrome ExtensionDemo VideoWiki Page

Use in: pagebuilder_custom_helper.php
Inside: customSortedListBlocks()

Reload the CMS after saving changes.
Use in: amsd_custom_helper.php
Inside: field_builder_custom_preset()

Check for duplicates, some custom field types may already exist.
Make sure you're in the correct database before running SQL.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

input example

<div cybdata="text" cybkey="Heading">Welcome to Our Website</div>

output example

<div><?= $DATA['Heading'] ?></div>

 

Detailed Example (Homepage Section)

 

Detailed Example (AMSD Page)

 

cybkey

cybkey attributes are used to identify the name/key of the data source:

ex: cybkey="Name of Input"

output: <?= $DATA['Name of Input'] ?>

cybdata

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

email

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:

<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 which works off of a vimeo or youtube video id

The php snippet detects if the video id is from vimeo or youtube based off of the number of characters (youtube has 11 characters and vimeo has 8)

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><? } ?>