Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1232246

    Kriesi’s Friends
    I am using Google Tag Manager to measure my page interactions and I need to create a unique id for each button inside the ROW OF BUTTONS container.

    Currently it lets me create an id just for the container and not independently.

    Could you help me?
    Thank you very much!

    #1232373

    Hey mtmundarain,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1232430

    Attached

    #1232630

    Hi mtmundarain,

    Yes, you add one id and we can help you with the selectors for the individual buttons.

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1232647

    Victoria
    Thank you so much
    I have the same situation in various containers around the entire site

    #1232711

    Hi mtmundarain,

    This is the selector for the first button .avia-buttonrow-wrap .avia-button:first-of-type

    This is the selector for the second .avia-buttonrow-wrap .avia-button:nth-of-type(2)

    Best regards,
    Victoria

    #1232730

    Victoria, thank you very much
    It seems to me that I am not understanding. Sorry

    I have many rows of double buttons all over the site:

    1.- Selector and ID is the same?
    1.-Can I create an ID for each button as in the rest of the enfold elements?
    2.-If I create a third button in the same row, what would be the selector?

    I need a little more context
    Thank you!

    #1232954

    Hi mtmundarain,

    You need to give id to the button rows. I did not see an id to the button row that I used.

    I looked at this one
    Image 2020-07-24 at 13.18.16.png

    With id’s it will be like this:

    
    #ptp-2.avia-buttonrow-wrap .avia-button:first-of-type
    
    #ptp-2.avia-buttonrow-wrap .avia-button:nth-of-type(2)
    

    Best regards,
    Victoria

    #1232985

    give to your button-row element a unique ID
    put this to child-theme functions.php

    function id_to_button_row_buttons(){
    ?>
    <script>
    (function($) {
    	var ButtonRowID = $('.avia-buttonrow-wrap').attr('id');
    	$('#'+ButtonRowID+' .avia-button').each(function(i) {
    	    $(this).attr('id', ButtonRowID+'-button'+(i+1));
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action( 'wp_footer', 'id_to_button_row_buttons');

    it will make the ID’s to your buttons as #ID-button1, #ID-button2, #ID-button3 etc the ID is the id you put on the button-row

    see here: https://webers-testseite.de/buttonrow/

    #1232999

    Great!
    It’s exactly what I was looking for!
    This forum is tops.
    Thank you both very much!

    #1233083

    Hi mtmundarain,

    Glad you got it working for you with Guenni007’s help! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1241510

    for more than one button row on the site:

    function id_to_button_row_buttons(){
    ?>
    <script>
    (function($) {
    	$('.avia-buttonrow-wrap').each(function(){
    		var that = this;
    		$('.avia-button', this).each(function(i){
    			var ButtonRowID = $(that).attr('id');
    			$(this).attr('id', ButtonRowID+'-button'+(i+1));
    		});
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action( 'wp_footer', 'id_to_button_row_buttons');

    see here: https://webers-testseite.de/buttonrow/

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.