Skip to content

Button Field

Settings:

button

Result:

button output

Output:

php
{$button|print}

Array
(
    [caption] => Text
    [type] => button
    [file] => 
    [href] => 
    [name] => name
    [attr] => data-popup-open="form"
    [resource] => 2
    [value] => value
    [classes] => btn-primary
    [published] => 1
    [disabled] => 0
    [target_blank] => 1
)

Example:

html
{if $button.published}
  <a 
      href="{$button.href?:($button.resource|resource:'uri')}"
      class="btn {$button.classes}"
      {$button.attr} 
      {if $button.target_blank} target="_blank"{/if}
  >
    {$button.text}
  </a>
{/if}

© PageBlocks 2019-present