Avada › Forums › Community Forum › Button Link with Parameter "[ ]" not working
-
AuthorPosts
-
Hi,
I would really appreciate the community’s help on the following problem:
I am trying to add a link to a button containing the parameter http://www.google.de/?aid=[AffiliateID]
Because of the “[ ]” my entire button is destroyed when saving the inserted link and updating the page.
Is there any way to add such an link containing the described special format?Thanks a lot for your answers.
Hi could you fix this? Im with the dame bug AND cant figure it out how could i make it work
I have the same issue with AVADA 7.3.1.
When I set button URL to https://mysite.com/?scn_id=%5Brec_id%5D it doesn’t wor and button is destroyed:
– any buttom customization is resetted (button type, button size, icon, and icon divider),
– and button URL is set to blank. and button text is filled with:" text_transform="" title="" target="_self" link_attributes="" alignment_medium="" alignment_small="" alignment="" modal="" hide_on_mobile="small-visibility,medium-visibility,large-visibility" sticky_display="normal,sticky" class="" id="" color="default" button_gradient_top_color="" button_gradient_bottom_color="" button_gradient_top_color_hover="" button_gradient_bottom_color_hover="" accent_color="" accent_hover_color="" type="flat" bevel_color="" border_width="" border_radius="" border_color="" border_hover_color="" size="small" stretch="default" margin_top="" margin_right="" margin_bottom="" margin_left="" icon="fa-address-card fas" icon_position="left" icon_divider="yes" animation_type="" animation_direction="left" animation_speed="0.3" animation_offset=""]button_label
Are you sure you need the brackets [ ]
I am shure in nothing! Really I don know how pass parametri to button url in a page eh ere I received parametri. I am in page https://mysite.com/page1/?scn_id=1234
And button should point to https://mysite.com/page2/?scn_id=1234 tryed put in url buttonhttps://mysite.com/page2/?scn_id=scn_id https://mysite.com/page2/?scn_id=@scn_id https://mysite.com/page2/?scn_id=%scn_id
With no results, so reading this post I was beleaving square brackets needed.
Yor example url works great, no problem adding this to the Button URL field.
https://mysite.com/page2/?scn_id=1234I cannot simply add https://mysite.com/page2/?scn_id=1234 in URL buttom because the value 1234 is passed as variable to the page1 where button is located. I try to describe better:
1. page1 is referred as https://mysite.com/page1/?scn_id=1234
2. into page1 I have a button that has to refer page2 passing the same value obtained into scn_idhttps://mysite.com/page2/?scn_id=<the-value-passed-to-page1>
All my issues are into page1. This page is receiving a parameter (scn_id) when is displayed with url https://mysite.com/page1/?scn_id=<the-value-passed-to-page1>
Into this page I need a button link to a second page that has to pass the same received parameter so into the button URL I cannot put a value because it is known only at “runtime” I should put into the URL link of the button something like https://mysite.com/page2/?scn_id=<the-value-passed-to-page1>Nou into page1 I can refer to scn_id but I do not know how to refer to it into the avada button.
Hello @vidierre,
I’m not exactly sure if this will help. But, have you tried using an HTTP GET method? GET is the standard way of sending name/value parameters in a URL to a page.
Here’s a live demo. The demo sends 2 visible and 2 hidden parameters to the same page (could be any page) for a total of 4 name/value pairs.
Good luck! 🙂
Yes @marklchaves, you are right. I was looking for something to avoide me the coding stuff. Bua as you point I had to go into coding. I solved my issue using the Code Snippet plugin and addin this code:
function show_imm_insertnew( $atts ) { global $current_user, $user_login; get_currentuserinfo(); add_filter('widget_text', 'do_shortcode'); // extract URL parameters $scn_id = $_GET['scn_id']; if ($user_login) return '<div style="text-align:left;"><style type="text/css">.fusion-button.button-1 {border-radius:4px;}</style><a class="fusion-button button-flat button-small button-default button-1 fusion-button-default-span fusion-button-default-type" target="_self" href="https://mysite.com/dp/page-02/?scn_id='.$scn_id.'"><span class="fusion-button-icon-divider button-icon-divider-left"><i class="fa-house-building fas" aria-hidden="true"></i></span><span class="fusion-button-text fusion-button-text-left">Aggiungi Erede</span></a></div>'; else return '<a href="' . wp_login_url() . ' ">Login</a>'; } add_shortcode( 'succ_immobili_insert', 'show_imm_insertnew' );
Mainly I added a function to extract the receive parameter and I return the same div structure used by Avada buttons, so they appear identical. The trick is in the code of the return statement:
<div style="text-align:left;"> <style type="text/css">.fusion-button.button-1 {border-radius:4px;}</style> <a class="fusion-button button-flat button-small button-default button-1 fusion-button-default-span fusion-button-default-type" target="_self" href="https://mysite.com/dp/page-02/?scn_id='.$scn_id.'"> <span class="fusion-button-icon-divider button-icon-divider-left"> <i class="fa-house-building fas" aria-hidden="true"></i> </span> <span class="fusion-button-text fusion-button-text-left">Aggiungi Erede</span> </a> </div>
-
AuthorPosts
- You must be logged in to reply to this topic.