WordPress.org

Ready to get started?Download WordPress

Forums

Simple Links
[resolved] Shortcode within link (8 posts)

  1. eric.hoegee
    Member
    Posted 1 year ago #

    Hi,

    First of all I love the plugin. I got one big problem though:

    I need to use iframe within the link. I installed a plugin for that (Advanced iFrame) which gives me a shortcode. ('[advanced_iframe securitykey="xxxxxxx" src="http://www.sears.com" width="100%" height="550px"]')

    If i copy this shortcode in my link field it will not work. It strips everything untill where my securitykey starts. ('[advanced_iframe securitykey=')

    Is there any way i can make it work like I want?

    http://wordpress.org/plugins/simple-links/

  2. Mat Lipe
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Eric,

    You may use the description field to enter your shortcode. Then you will have to enable shortcode support by using a couple of the built in filters. You may add the code to your theme's functions.php file.

    add_filter('simple_links_shortcode_link_meta', 'sl_do_shortcodes');
    add_filter('simple_links_shortcode_link_output', 'sl_prevent_shortcode', 99, 4);
    function sl_prevent_shortcode($link_output, $meta, $link, $image ){
        $link_output = sprintf('<a href="%s" target="%s" title="%s" %s>%s%s</a>',
                                        $meta['web_address'][0],
                                        $meta['target'][0],
                                        $link->post_title,
                                        empty( $meta['link_target_nofollow'][0] ) ? '': 'rel="nofollow"',
                                        $image,
                                        $link->post_title
                                 );
        return $link_output;
    
    }
    
    function sl_do_shortcodes($meta){
        if( isset( $meta['description'][0] ) ){
            $meta['description'][0] = do_shortcode($meta['description'][0]);
        }
        return $meta;
    }

    Hope this helps!

  3. eric.hoegee
    Member
    Posted 1 year ago #

    Hi Mat,

    Thanks for your advice and code. I placed it in my theme's functions.php I placed the shortcode in my description field. I guess I need to leave the Web Address field empty right? Anyway, i can't get it to work. Could you maybe take a look and point me the way? I would be forever grateful! :)

    On http://www.mimallz.com/stores/department-stores-2/ you will find a link to sears.com that is supposed to run the shortcode.

    Hope to hear from you, if you got any questions don't hesitate...

  4. eric.hoegee
    Member
    Posted 1 year ago #

    Hi Mat,

    The URL right now leads me to the where i am now. So on my http://www.mimallz.com/stores/ pages it leads me to http://www.mimallz.com/stores/. If i click the link in http://www.mimallz.com/stores/department-stores-2/ it leads me http://www.mimallz.com/stores/department-stores-2/

    Maybe that helps :)

    Thanks in advance

  5. Mat Lipe
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Eric,
    When you add the shortcode to your content do you have the description turned on?

    If not your shotcode should look something like this.
    [simple-links description="true"]

    To make it link out to you will want to fill in the Web Address field.

    To hide the link and just display the iframe content you could use some css like

    .simple-links-shortcode-item a{
    display: none;
    }

    Hope this helps!

  6. eric.hoegee
    Member
    Posted 1 year ago #

    Hi Mat,

    Thanks for your tips yet again :) Now the iframe opens up, not really like i would want it though. ;)

    I don't think you understand what I am trying to accomplish here. The idea is that I can have lists of links under each other. I am making a selection of web shops (300+) which i put on different pages with categories. So, I make a link, I put it in Category Department stores. I want it to be displayed just on the pages i selected the category for (could be multiple). So far it works.

    On these pages I want only links, no iframes.

    When links are being clicked I want another page to be opened, within that page the iframe must be opened.

    Hope i made myself clear this time and really hope you are capable and willing to help me out yet again. :)

    Thanks and have a good one,

    Eric

  7. Mat Lipe
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Eric,

    I'm afraid this is a little beyond my free support.

    You might give the main wordpress.org forum a try and see if someone from the community can give you a hand. I am totally swamped right now with client work.

  8. eric.hoegee
    Member
    Posted 1 year ago #

    Hi Mat,

    I can imagine, no problem. Thanks for all your help anyway!

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic