New Landing How can we help? Themeforest Theme Support Dante Alt and Title tags – within button shortcodes?

Viewing 15 posts - 1 through 15 (of 17 total)
  • Posted in: Dante
  • #176334
    dekkydog
    Member
    Post count: 59

    Hi there,
    I would really like to have alt and title tags within button shortcodes as u can with regular text links. When Adding them manually within the button shortcode they get stripped in the browser? (I have checked in Firebug).

    Do you have a hack / method for allowing these web standard tags?

    Cheers

    #176356
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    I’m afraid there isn’t currently a parameter in the button shortcode for alt tags and title tags. Something I will add to the list however not had anyone ask for this before

    – Kyle

    #176362
    dekkydog
    Member
    Post count: 59

    ok,
    alt and title tags are a very old web standard. Others may not have asked because they may not appreciate the value of these tags?

    No temporary work around until this is added into the framework?

    Cheers

    #176363
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me specific page url with strip button. I will give to you custom css code to resolve the issue.

    Thanks
    Mohammad

    #176366
    dekkydog
    Member
    Post count: 59

    Hi,
    I’m developing locally. Its just a standard button shortcode:

    [sf_button colour="accent" type="standard" size="large" link="#" target="_self" icon="" dropshadow="no" extraclass="" title="A custom title tag that gets stripped"]Large button[/sf_button]

    Cheers

    #176367
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please attach screenshot of your issue.
    Thanks
    Mohammad

    #176370
    dekkydog
    Member
    Post count: 59

    Hi,
    no screenshot required here? Do you know what a title tag (attribute) is? – http://www.w3.org/TR/WCAG20-TECHS/H33.html

    In the shortcode (I posted above) the – title=”A custom title tag that gets stripped” is the part that gets removed in the browser IE: I manually added this attribute to the shortcode, its NOT there by default. I don’t think you can aleviate this issue with css?

    #176377
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Yes it gets stripped because there is no such parameter ‘title’ for the shortcode. The only workaround would be to use html for the button instead of the shortcode, for e.g:

    <a class="sf-button standard accent" href="#" target="_self"><span class="text">TAKE THE TOUR TO FIND OUT MORE</span></a>

    – Kyle

    #176383
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please open to edit shortcodes.php file at /dante/swift-framework/.

    1- Find this code:-
    $button_output .= '<a class="'.$button_class.'" href="'.$link.'" target="'.$target.'">';
    
    Change with:-
    $button_output .= '<a class="'.$button_class.'" href="'.$link.'" target="'.$target.'" title="'.$title.'">';
    
    2- Find this code:-
    "extraclass"   => ''
    
    Change with:-
    "extraclass"   => '',
    "title"=>''

    Thanks
    Mohammad

    #176384
    dekkydog
    Member
    Post count: 59

    Thanks ๐Ÿ™‚

    Will add a filter in my functions.php to apply to the framework.

    Appreciate your help.

    Cheers

    #176386
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    No problem, thanks Mohammad

    – Kyle

    #176424
    dekkydog
    Member
    Post count: 59

    Hi there,
    your temporary hack works fine ๐Ÿ™‚ but I have been trying to do this from my functions.php but doesn’t seem to work? Can you take a quick look at this and tell me if you see any obvious issue (am I missing something here?):

    add_action( 'after_setup_theme', 'my_dante_shortcode' );
    
    function my_dante_shortcode() {
    if (!function_exists('sf-button')) {
       remove_shortcode( 'sf-button' );
    }
       add_shortcode( 'sf-button', 'my-button' );
    
    }
    	function my_button($atts, $content = null) {
    		extract(shortcode_atts(array(
    			"size"			=> "standard",
    			"colour"		=> "",
    			"type"			=> "",
    			"link" 			=> "#",
    			"target"		=> '_self',
    			"dropshadow"            => '',
    			"icon"			=> '',
    			"extraclass"            => '',
    			"title"                 => ''
    		), $atts));
    		
    		$button_output = "";
    		$button_class = 'my-button '.$size.' '. $colour .' '. $type .' '. $extraclass;
    				
    		if ($dropshadow == "yes") {
    		$button_class .= " dropshadow";
    		}
    		
    		if ($type == "sf-icon-reveal" || $type == "sf-icon-stroke") {
    			$button_output .= '<a class="'.$button_class.'" href="'.$link.'" target="'.$target.'" title="'.$title.'">';
    			$button_output .= '<i class="'.$icon.'"></i>';
    			$button_output .= '<span class="text">'. do_shortcode($content) .'</span>';
    			$button_output .= '</a>';
    		} else {
    			$button_output .= '<a class="'.$button_class.'" href="'.$link.'" target="'.$target.'" title="'.$title.'"><span class="text">' . do_shortcode($content) . '</span></a>';
    		}
    		
    		return $button_output;
    	}
    	add_shortcode('my_button', 'my_button');

    Really don’t want to alter the main theme for future updates!

    Cheers

    #176445
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    That won’t work unfortunately, as the child theme funtcions.php runs first, so the function will not exist yet for:

    if (!function_exists('sf-button')) {
       remove_shortcode( 'sf-button' );
    }
       add_shortcode( 'sf-button', 'my-button' );
     
    }

    to take effect, however when it runs the parent theme the function will break because it does not have the !function_exists statement

    For now you will just have to make the change to the parent theme

    – Kyle

    #176461
    dekkydog
    Member
    Post count: 59

    Ok. Is this feature likely to make it into the next minor release of the Dante theme?

    Cheers

    #176464
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    I’ll pass on to the developer to consider

    – Kyle

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register