New Landing How can we help? Themeforest Theme Support Flexform Text Block Widget TItle as Link

Viewing 12 posts - 1 through 12 (of 12 total)
  • Posted in: Flexform
  • #26359
    mrdfrost
    Member
    Post count: 15

    It would be much more intuitive if the widget title had the option to act as a the link to whatever content we are getting users to go to.

    How would I go about doing this?

    #26499
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Did you try this plugin? http://wordpress.org/plugins/widget-title-links/

    Let me know, what you got.

    Thanks,
    laranz.

    #26654
    mrdfrost
    Member
    Post count: 15

    I am not sure how I would get this to get change your wpb_heading into a link though.
    The titles beside the icons within the 4 sections on this page. http://working.inkochostudios.com/ait4you/

    #26990
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Oh sorry you mean the swift page builder’s text widget and its title? I thought you are asking for the default Widget title in Appearance -> Widgets. Apologies for the confusions. That is not possible at the moment by default.

    Thanks,
    laranz.

    #28214
    mrdfrost
    Member
    Post count: 15

    Where would I need to look within the code to make that a reality?

    #28246
    HighlandMarketing
    Member
    Post count: 4

    Hi all!

    I’ve been following this thread as I needed to link the text block title.

    When support came back and said ‘not possible’ I decided I’d better code it myself!

    Disclaimer: this is a complete and utter blatant hack of the original code which will be lost on updating the theme. There will be a much prettier and foolproof way to do this but at this point I needed a quick hack that does the job which I can come back to later to complete. It assumes that you want to link every box title rather than checking if the attribute is set before inserting the link – easily adjusted but don’t have the time at the moment!

    So in ‘/wp-content/themes/flexform/includes/page-builder/composer/lib/shortcodes/default.php’ I replaced the following code (line 62-115):

    class WPBakeryShortCode_box extends WPBakeryShortCode {
    
        public function content( $atts, $content = null ) {
    
            $title = $type = $custom_styling = $custom_bg_colour = $custom_text_colour = $pb_margin_bottom = $el_class = $width = $el_position = '';
    
            extract(shortcode_atts(array(
            	'title' => '',
            	'type'	=> '',
            	'custom_bg_colour' => '',
            	'custom_text_colour' => '',
            	'pb_margin_bottom' => 'no',
                'el_class' => '',
                'el_position' => '',
                'width' => '1/2'
            ), $atts));
    
            $output = '';
    
            $el_class = $this->getExtraClass($el_class);
            $width = wpb_translateColumnWidthToSpan($width);
    
            $el_class .= ' wpb_box_text';
            $el_class .= ' '.$type;
            
            if ($pb_margin_bottom == "yes") {
            $el_class .= ' pb-margin-bottom';
            }
            
            if ($custom_bg_colour != "") {
            $custom_styling .= 'background: '.$custom_bg_colour.'!important;';
            }
            
            if ($custom_text_colour != "") {
            $custom_styling .= 'color: '.$custom_text_colour.'!important;';
            }
    
            $output .= "\n\t".'<div class="wpb_content_element '.$width.$el_class.'">';
            $output .= "\n\t\t".'<div class="wpb_wrapper">';
            $output .= ($title != '' ) ? "\n\t\t\t".'<div class="heading-wrap"><h3 class="wpb_heading wpb_text_heading"><span>'.$title.'</span></h3></div>' : '';
            $output .= "\n\t\t\t";
            if ($custom_styling != "") {
            $output .= '<div class="box-content-wrap" style="'.$custom_styling.'">'.do_shortcode($content).'</div>';
            } else {
            $output .= '<div class="box-content-wrap">'.do_shortcode($content).'</div>';
            }
            $output .= "\n\t\t".'</div> ' . $this->endBlockComment('.wpb_wrapper');
            $output .= "\n\t".'</div> ' . $this->endBlockComment($width);
    
            //
            $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
            return $output;
        }
    }'

    with:

    class WPBakeryShortCode_box extends WPBakeryShortCode {
    
        public function content( $atts, $content = null ) {
    
            $title = $type = $custom_styling = $custom_bg_colour = $custom_text_colour = $pb_margin_bottom = $el_class = $width = $el_position = '';
    
            extract(shortcode_atts(array(
            	'title' => '',
                'type'  => '',
                'link'  => '',
                'target'  => '',
            	'custom_bg_colour' => '',
            	'custom_text_colour' => '',
            	'pb_margin_bottom' => 'no',
                'el_class' => '',
                'el_position' => '',
                'width' => '1/2'
            ), $atts));
    
            $output = '';
    
            $el_class = $this->getExtraClass($el_class);
            $width = wpb_translateColumnWidthToSpan($width);
    
            $el_class .= ' wpb_box_text';
            $el_class .= ' '.$type;
            
            if ($pb_margin_bottom == "yes") {
            $el_class .= ' pb-margin-bottom';
            }
            
            if ($custom_bg_colour != "") {
            $custom_styling .= 'background: '.$custom_bg_colour.'!important;';
            }
            
            if ($custom_text_colour != "") {
            $custom_styling .= 'color: '.$custom_text_colour.'!important;';
            }
    
            $output .= "\n\t".'<div class="wpb_content_element '.$width.$el_class.'">';
            $output .= "\n\t\t".'<div class="wpb_wrapper">';
            $output .= ($title != '' ) ? "\n\t\t\t".'<div class="heading-wrap"><h3 class="wpb_heading wpb_text_heading"><span><a href="'.$link.'" target="'.$target.'">'.$title.'</a></span></h3></div>' : '';
            $output .= "\n\t\t\t";
            if ($custom_styling != "") {
            $output .= '<div class="box-content-wrap" style="'.$custom_styling.'">'.do_shortcode($content).'</div>';
            } else {
            $output .= '<div class="box-content-wrap">'.do_shortcode($content).'</div>';
            }
            $output .= "\n\t\t".'</div> ' . $this->endBlockComment('.wpb_wrapper');
            $output .= "\n\t".'</div> ' . $this->endBlockComment($width);
    
            //
            $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
            return $output;
        }
    } 

    You can then use the attribute ‘link=”www.google.com”‘ in the [box] shortcode:

    [box title="Title" type="Type" pb_margin_bottom="no" el_class="Class" width="1/1" link="http://www.google.com"]Content[/box]

    Hope this helps you out!

    #28273
    mrdfrost
    Member
    Post count: 15

    Thanks Highland, I will have a look at this later on this evening.
    Cheers!

    #28571
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi @HighlandMarketing,

    Thanks for the heads-up. ๐Ÿ™‚

    I said it is not possible by *default*, with custom code everything is possible ๐Ÿ˜‰

    Thanks,
    laranz.

    #28626
    HighlandMarketing
    Member
    Post count: 4

    Hi @Laranz

    Indeed everything is possible with custom code. It’s disappointing that a 5-star support response to this query, which Swift Ideas advertise when selling their themes, was “that is not possible at the moment by default”.

    Perhaps a 6-star support response would be “Sorry, that is not possible at the moment by default. Try looking in โ€˜/wp-content/themes/flexform/includes/page-builder/composer/lib/shortcodes/default.phpโ€™ for the code behind the [box] shortcode.”?

    #28760
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Sorry, for the inconvenience.

    Why we don’t reply like that means, most of them are not coding people, if we tell like maybe they screw the coding and the web page didn’t work.. If you ask how to do after my reply, we are happy to help you. I don’t know you code or not.. Hope you understand.

    Thanks,
    laranz.

    #28775
    HighlandMarketing
    Member
    Post count: 4

    Hi Laranz,

    Thanks for the ‘heads-up’.

    How do you know most of your customers are not coding people? Is this just an assumption that strings out questions like this from being sorted within 24-48 hours to nearly 2 weeks? Do you see what I’m highlighting? You could cover all bases by pointing the customer in the correct direction in the first reply as well as abandoning them with an ‘it’s not possible by default’.

    Thanks

    #28790
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Sorry the inconvenience caused.

    After you asking this question “Where would I need to look within the code to make that a reality?” someone in the forum answer you, If he didn’t surely I will help you the same way or at least point you in the correct direction. Sorry if you misunderstand my answers. Anything other than the theme defaults are taken as customization, we won’t cover those, but if it small like these we sure help you the way as quick as possible. Hope you understand.

    Thanks,
    laranz.

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