WordPress.org

Ready to get started?Download WordPress

Forums

Alligator Popup
[resolved] Make menu-item refer to popup (14 posts)

  1. MonMidt
    Member
    Posted 9 months ago #

    Hi there!

    Thx for a super plugin! So far it works like a charm. I managed to make a gif on my page to be a popup when clicked on. Now I want to do the same with li-items in a custom menubar of mine... HOW can I do this?

    I tried to wrap the shortcode into the html-code, but no luck... I'm quite a novise to web-coding, som I'm sure I've missed out on something very relevant, but would appreciate the help, if this is possible!

    P.s: Did the bloke wrestle the Alligator yet?

    http://wordpress.org/plugins/alligator-popup/

  2. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 9 months ago #

    What code are you using for your menubar & where are you putting it? Also a link to your site might help. If I can see what you're trying to achieve, I should be able to work out whether it is possible either with the plugin as it is, or with a modification.

    re the ps: I've not heard from him for a few days so he's either still planning the bout or it has taken place and he was the runner-up.

  3. MonMidt
    Member
    Posted 9 months ago #

    Hi!
    The site I'm building is confidential until the launch, but this is the menubar-code:

    <div id="menubar">
    
    <ul>
            	<li><a href="http://mmysite.com/about/">about</a></li>
            	<li><a href="http://www.mysite.com/contact/">contact</a></li>
    		<li><a href="[popup url="http://www.mmysite.com/login/" height="475" width="460"][/popup]">login</a></li>
    </ul>
    </div><!--menubar-->

    Hope this will give u some insight :)

  4. MonMidt
    Member
    Posted 9 months ago #

    I'm building it for a customer, and I've signed a confidentiality agreement...

  5. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 9 months ago #

    The shortcode puts in the anchor tag & the syntax dictates that the link text needs to be between the opening & closing parts of the shortcode, so you don't need to specify these outside of the shortcode.

    If you are putting this markup into page/post content, the syntax should be slightly different to what you are trying to use. I've not tested it, but try this instead

    <div id="menubar">
    
    <ul>
            	<li><a href="http://mmysite.com/about/">about</a></li>
            	<li><a href="http://www.mysite.com/contact/">contact</a></li>
    		<li>[popup url="http://www.mmysite.com/login/" height="475" width="460"]login[/popup]"></li>
    </ul>
    </div><!--menubar-->

    If you are instead putting it into a php file in your theme such as a template, it will be a little more fiddly. Let me know if that is the case - I should be able to suggest some code using the do_shortcode() function or an alternative method

  6. MonMidt
    Member
    Posted 9 months ago #

    I'm putting into template-files, and that is why I struggle...
    I would be glad if u are able to help me figure this out though. I'm new to this, and even though I've had a steep learning curve from zero to some (I started this a few weeks ago), I'm not at all familiar with how and when to use the function-codes.

    I want the buttons in this custom menubar to open the popup-window when clicked on. I've created a template for almost all my custom pages, and the menubar in question is part of several of them. The template is based on the page.php.

    Thx ever so much for your help!
    P.s: Hope the alligator-wrestler is alive and kicking :P

  7. MonMidt
    Member
    Posted 9 months ago #

    I tried your code but this is what shows in the browser: http://www.mysite.com/'[popup%20url=

    and the message on the page says "nothing was found".... so I probably will need to use some other method ;)

  8. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 9 months ago #

    Shortcodes won't work if added to a template file like this, so it is not unexpected that it didn't work.

    As this is to go into the template it probably best to avoid the overhead of using the shortcode. Instead you can add the html link using the same syntax that the shortcode would output. If the parameters are the same it will allow the jQuery to make the popup in the same way as using the shortcode in a page.

    Try this:

    <div id="menubar">
    <ul>
    	<li><a href="http://mmysite.com/about/">about</a></li>
    	<li><a href="http://www.mysite.com/contact/">contact</a></li>
    	<li><a href="http://www.mmysite.com/login/" class="popup" data-height="475" data-width="460">login</a></li>
    </ul>
    </div><!--menubar-->

    The jQuery added by the plugin is triggered by the 'popup' class and the data-attributes pass the values for width & height.

    I don't know what theme you are using so I cannot test this, but I think this should work in most cases.

  9. MonMidt
    Member
    Posted 9 months ago #

    You are an angel! That worked like a charm :)

    I'm making my own theme for this customer based on: _s-hteme from ThemeShaper :)

    Thx ever so much for your time and for helping me! It saved me many an hour of trying and failing :)

    Have a really nice weekend :)

  10. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 9 months ago #

    Great! - Glad it worked for you.

    If you'd like to leave a review for the plugin, that would be appreciated.

  11. MonMidt
    Member
    Posted 9 months ago #

    Of course I will :)

  12. MonMidt
    Member
    Posted 9 months ago #

    Cubecolor, I would love to ask you another question. Where can I do this?

    I might have another "alligator-challange" for you ;)

  13. cubecolour
    ɹoʇɐɹǝpoɯ
    Plugin Author

    Posted 9 months ago #

    If its regarding some specific custom work you would like to commission, that kind of conversation doesn't take place on the forums, but you can send me a message via the contact form on my own website.

    Otherwise for free help it would be best to start a new thread in the relevant forum.

    If your question is related to alligator popup or one of my other plugins, the plugin's forum would be the best place. If you want WordPress support with something unrelated to any specific plugin, it would probably be best to ask in the how-to & troubleshooting forum where any forum volunteer would be able to pitch in.

  14. MonMidt
    Member
    Posted 9 months ago #

    Ok, thx :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags