Need some additional help on CS Parameters

Hi,

Please help me understand the related groups of parameters in Cornerstone. I could not figure that out yet from the documentation available on Theme.co site.

Let’s consider the example of link type parameters within the default Button Element. We have three sets of parameters there. One is for regular http URLs, another one for maito: URLs and the third is for tel: URLs.

The documentation explaines how to make a Custom Managed Parameters set here. It is not difficult to adjust the example provided to get the set of http, mailto and tel icons. From the main Doсs on Parameters, we learn how to make different field types and connect them with the fields inside default CS elements. One thing which I haven’t figured out yet is how to link those two together?

Depending on the selection within the Custom Managed Parameters block, we need to initiate the corresponding sets of other parameters. What did I miss or is this explanation beyond the scope of Support because it requires more advanced custom coding of more advanced Custom Managed Parameters?

Hey John,

Based on the Documentation, you may add this sample code to your child theme’s functions.php file:

// Custom managed Link parameter
add_action('after_setup_theme', function() {
    cs_parameters_managed_register('link-test', [
        'type'     => 'choose',
        'initial'  => '#',
        'offValue' => 'none',
        'options'  => [
            [ 'value' => 'http',    'icon' => 'ui:link'    ],
            [ 'value' => 'mailto',  'icon' => 'ui:mail'  ],
            [ 'value' => 'tel',   'icon' => 'ui:phone'   ]
        ],
    ]);
});

Create a component and in your Button component parameter, you can add:

{
  "linkTest": {
    "type": "link-test"
  }
}

And this you will have:
image

You may need additional parameters like text and conditional parameters to show/hide which parameter, depending on the selection, http, mail, or tel.

Hope this helps.

Thanks @ruenel,

The Conditional Parameters slipped from my attention. The next two questions:

  1. How to make an uneditable Preview field like in the default Button Element?
  2. How can we link all three options to the button’s Primary URL field so that only the one chosen by the conditional parameters is used? Essentially we don’t have control over custom management properties in breakout mode. If we change each option in the Primary tab and then link the URL, Email, and Phone fields to created JSON fields one by one, only the last one gets saved.

2026-05-17_13-49-18

Hey @referee,

To me that would require more custom coding. But, I’ll ask Runel if he has an idea.

Hey @christian,
Whatever Rue’s answer may be, thank you for your patience and details provided every time. That really helps to better understand how Themeco’s products work and what they are capable of.

  1. This is not supported right now, it’s a custom React component on our end that creates that preview.
  2. The button isn’t actually a value internally. You can kind of get around this by doing something like the following screenshot with {{dc:p:linkType}}:{{dc:p:url}}. However I have to update how urls are handled on our end to fully support this. It will only work with email and telephone currently.
    image

Have a great day.

Thanks @charlie. That’s good to know.

You’re most welcome John.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.