New Landing How can we help? Themeforest Theme Support Dante link in progress bar

Viewing 14 posts - 1 through 14 (of 14 total)
  • Posted in: Dante
  • #99775
    cecconello
    Member
    Post count: 9

    Hi!
    I would like to make each item of the progress bar a link to another page of the site.
    Can you suggest me how to modify the shortcode in order to get this?
    Thank you so much!

    #99847
    Melanie – SUPPORT
    Member
    Post count: 11032

    Hi,

    in shortcodes.php find the code

    	/* SERVICES PROGRESS BAR SHORTCODE
    	================================================= */
    	
    	function sf_progress_bar($atts) {
    		extract(shortcode_atts(array(
    			"percentage" => '',
    			"name" => '',
    			"type" => '',
    			"value" => '',
    			"colour" => ''
    		), $atts));
    		
    		if ($type == "") { $type = "standard"; }
    		
    		$service_bar_output = '';
    		
    		$service_bar_output .= '<div class="progress-bar-wrap progress-'.$type.'">'. "\n";
    		if ($colour != "") {
    		$service_bar_output .= '<div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value" style="color:'.$colour.'!important;">'.$value.'</span></div>'. "\n";
    		$service_bar_output .= '<div class="progress '.$type.'">'. "\n";
    		$service_bar_output .= '<div class="bar" data-value="'.$percentage.'" style="background-color:'.$colour.'!important;">'. "\n";
    		} else {
    		$service_bar_output .= '<div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value">'.$value.'</span></div>'. "\n";
    		$service_bar_output .= '<div class="progress '.$type.'">'. "\n";
    		$service_bar_output .= '<div class="bar" data-value="'.$percentage.'">'. "\n";		
    		}
    		$service_bar_output .= '</div>'. "\n";
    		$service_bar_output .= '</div>'. "\n";
    		$service_bar_output .= '</div>'. "\n";
    		
    		global $sf_has_progress_bar;
    		$sf_has_progress_bar = true;
    		
    		return $service_bar_output;
    	}
    	
    	add_shortcode('progress_bar', 'sf_progress_bar');

    and replace it with

    	/* SERVICES PROGRESS BAR SHORTCODE
    	================================================= */
    	
    	function sf_progress_bar($atts) {
    		extract(shortcode_atts(array(
    			"percentage" => '',
    			"name" => '',
    			"type" => '',
    			"value" => '',
    			"colour" => '',
    			"link" => ''
    		), $atts));
    		
    		if ($type == "") { $type = "standard"; }
    		
    		$service_bar_output = '';
    		
    		$service_bar_output .= '<div class="progress-bar-wrap progress-'.$type.'">'. "\n";
    		if ($colour != "") {
    		$service_bar_output .= '<a href="'.$link.'"><div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value" style="color:'.$colour.'!important;">'.$value.'</span></div>'. "\n";
    		$service_bar_output .= '<div class="progress '.$type.'">'. "\n";
    		$service_bar_output .= '<div class="bar" data-value="'.$percentage.'" style="background-color:'.$colour.'!important;">'. "\n";
    		} else {
    		$service_bar_output .= '<div class="bar-text"><span class="bar-name">'.$name.':</span> <span class="progress-value">'.$value.'</span></div>'. "\n";
    		$service_bar_output .= '<div class="progress '.$type.'">'. "\n";
    		$service_bar_output .= '<div class="bar" data-value="'.$percentage.'">'. "\n";		
    		}
    		$service_bar_output .= '</div>'. "\n";
    		$service_bar_output .= '</div></a>'. "\n";
    		$service_bar_output .= '</div>'. "\n";
    		
    		global $sf_has_progress_bar;
    		$sf_has_progress_bar = true;
    		
    		return $service_bar_output;
    	}
    	
    	add_shortcode('progress_bar', 'sf_progress_bar');

    This should leave you with the new attribute link=”…” to use within the shortcode!

    Let me know if it worked. If it didn’t work, please post up your website URL with the faulty code on it!

    #99914
    cecconello
    Member
    Post count: 9

    Hi thanks a lot.
    I’ve just tried to do it, but I get the error you can check here: http://www.simonacolonna.it/geo_eng/wp-admin/theme-editor.php?file=swift-framework%2Fshortcodes.php&theme=dante&scrollto=16107&updated=true

    I also attached a screenshot of the error, please let me know what I can do!
    Thanks

    Attachments:
    You must be logged in to view attached files.
    #99926
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Please double check that you copied and pasted the whole code

    – Kyle

    #99931
    cecconello
    Member
    Post count: 9
    This reply has been marked as private.
    #99933
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    please go to line 841 and make sure there is not a double semi-colon ‘;;’

    – Kyle

    #99936
    cecconello
    Member
    Post count: 9
    This reply has been marked as private.
    #99938
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Please revert back to the original version of the file, I will have to check the code that Melanie provided

    – Kyle

    #99943
    cecconello
    Member
    Post count: 9
    This reply has been marked as private.
    #99952
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Please delete the theme using ftp and install this version: https://www.dropbox.com/s/aqokzr0d6nnbqbf/dante.zip

    – Kyle

    #99962
    cecconello
    Member
    Post count: 9
    This reply has been marked as private.
    #99980
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    After looking into it I don’t think it’s simple to add links to each bar. If you need this functionality you will need to hire a developer

    – Kyle

    #100005
    cecconello
    Member
    Post count: 9
    This reply has been marked as private.
    #100011
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    No problem

Viewing 14 posts - 1 through 14 (of 14 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