rtmedia and mla lightbox
-
Hi !
I’m using rtmedia pro with mla. this is a great combination.
I just need to know if there’s a way to use rtmedia lightbox instead of mla lightbox.
Is there a hook or something in the template system i can use ?
thank you !
-
Thank you for the good words and your question. I am happy to hear you find MLA and rtMedia a good combination.
I am not sure what you mean by the “rtMedia lightbox”. I cannot find a reference to it in the rtMedia documentation on their web site. All I found was an rtMedia Pro option to display single images in a “Facebook style lightbox”. If you are using s shortcode to access the lightbox can you post an example?
In general, MLA supports many of the lightbox and gallery plugins available for WordPress. Here’s an earlier support topic that goes into some detail on the topic:
Please update this topic with any additional information you can give me that will let me be more helpful. Also, let me know if you found the earlier topic helpful or have additional questions I can answer. I will leave this topic unresolved until I hear back from you. Thanks for your interest in the plugin.
Hey !
Thank you for your answer.
Yes is the “Facebook style lightbox”. I’m triyng to get it work with mla. I’ve modified the template base.
I’ve got something but, i dont know how to get media URL like this :
http://site.url/members/user/media/187/My template is :
<ul class='rtmedia-list rtmedia-list-media'> <li class="rtmedia-list-item"> <a href="[+MEDIA URL -or RTMEDIA PERMALINK ? +]"> <div class="rtmedia-item-thumbnail"><img src="[+link_url+]" ></div> <div class="rtmedia-item-title"></div> </a> </li> </ul>If you have any idea … i’m in :p
Thanks for your update and for taking the time to give the example URL and the additional information.
From your example URL it looks like you are using BuddyPress in addition to rtMedia; is that right?
If so, you might be able to use the example plugin developed in response to this earlier support topic:
Overwhelmed. Help my shortcode out? 🙂
To make that long story short, I added a new example plugin, /examples/buddypress-hooks-example.php.txt, to my MLA version 1.90. You might be able to use that example plugin as-is or adapt it for your application.
When you say “My template is“, are you referring to an MLA markup template or to a PHP template of some kind? If you can give me the context in which the template is used it would help me give you more specific guidance. Thanks.
Thanks David For all the details.
In fact i’m using your templating system in the admin panel with the specific shortcodes you made [+something+].
I’v looked through the doc to use filter. but i dont understand how it work. I’ve activated the plugin /examples/buddypress-hooks-example.php.txt and uncommented
I’m using in my page :
[mla_gallery my_filter="mla_gallery_item_values_filter" tax_query="array( array( 'taxonomy' => 'rt_pays', 'field' => 'slug', 'terms' => 'france' ) )"]Or :
[mla_gallery mla_gallery_item_values_filter="buddypress_urls" tax_query="array( array( 'taxonomy' => 'rt_pays', 'field' => 'slug', 'terms' => 'france' ) )"]but cant get the attachement page url.
my idea was to use :
<ul class='rtmedia-list rtmedia-list-media'> <li class="rtmedia-list-item"> <a href="[+MEDIA URL -or RTMEDIA PERMALINK ? +]"> <div class="rtmedia-item-thumbnail"><img src="[+link_url+]" ></div> <div class="rtmedia-item-title"></div> </a> </li> </ul>and something like this [+MEDIA URL -or RTMEDIA PERMALINK ? +] to get buddypress /rtmedia attachement url of the image.
What do you think its better to use ? and how filter are working ? (sorry i’m pretty noob for this).
Really thanks for your help
Thanks for your update. It’s nice to hear you found the MLA template system to be useful. The template functions are inspired by the book “WordPress 3 Plugin Development Essentials” with several enhancements.
It sounds like you have copied
/examples/buddypress-hooks-example.php.txtto your/wp-content/pluginsdirectory, renamed it tobuddypress-hooks-example.phpand used the Plugins/Installed Plugins submenu to activate it. Is that right? I am not sure what you mean by “uncommented” – can you explain?The example plugin uses the Plugin API to “hook” three of the filters provide by MLA. The code in the example plugin looks for a unique parameter,
buddypress_urls, in your[mla_gallery]shortcode and if it finds the parameter it will change the links behind each gallery item to the format you are looking for.In the
[mla_gallery]examples you’ve given in your post thetax_queryparameter looks good. To activate the example plugin, your shortcode should look like this:[mla_gallery buddypress_urls=true tax_query="array( array( 'taxonomy' => 'rt_pays', 'field' => 'slug', 'terms' => 'france' ) )"]As you can see, it’s the
buddypress_urls=truethat activates the example plugin. If you want to use the “cover art” rtMedia provides for audio and video media, you would codebuddypress=cover.The
mla_gallery_item_values_filteris used inside the example plugin, to tell WordPress what function to call to “hook into” the filters MLA provides. You do not need it in your[mla_gallery]shortcode.Inside the example plugin, code in the
mla_gallery_item_values_filterfunction replaces two of the “Attachment-specific substitution parameters” with rtMedia-style URLs. The[+link+]parameter contains both the img tag for the thumbnail/cover art and the link surrounding it. The[+link_url+]parameter is just the href value for the link surrounding the thumbnail/cover art img tag. If you codebuddypress=cover, the plugin also replaces[+thumbnail_content+],[+thumbnail_width+],[+thumbnail_height+]and[+thumbnail_url+].Here’s an example from my test system. The shortcode is:
[mla_gallery tax_query="array( array( 'taxonomy' => 'rt_kingdom', 'field' => 'slug', 'terms' => 'animal' ) )" post_mime_type='all' buddypress_urls=cover mla_rollover_text="{+title+}" mla_caption="{+title+}"]And one of the gallery items looks like:
<dl class="gallery-item "> <dt class="gallery-icon landscape"> <a title="Dark Side Open_1280x720" href="http://wpectest/members/dlingren/media/5/"><img width="150" height="150" class="attachment-thumbnail" alt="Dark Side Open_1280x720" src="http://wpectest/wp-content/uploads/2014/06/David_Lingren-150x150.jpg"></a> </dt> <dd class="wp-caption-text gallery-caption"> Dark Side Open_1280x720 </dd> </dl>For the template you’ve given, I would suggest something like this:
<ul class='rtmedia-list rtmedia-list-media'> <li class="rtmedia-list-item"> [+link+] </li> </ul>or perhaps:
<ul class='rtmedia-list rtmedia-list-media'> <li class="rtmedia-list-item"> <a href="[+link_url+]"> <div class="rtmedia-item-thumbnail">[+thumbnail_content+]</div> <div class="rtmedia-item-title">[+title+]</div> </a> </li> </ul>I hope that gives you the answers you need. I will leave this topic unresolved until I hear back from you about your progress and any further problems or questions. Thanks for your patience and for your interest in the plugin.
Thank you for your help !! It’s working 🙂
Best support ever !
For those who are trying to do it here is my setup yo use “facebook style lightbox” from rtmedia / buddypress :
1/ I have copied /examples/buddypress-hooks-example.php.txt to your /wp-content/plugins directory, renamed it to buddypress-hooks-mla.php
2/ Activate the plugin in admin panel
3/ In the admin panel, go to Settings -> MLA -> MLA Gallery
4/ At the end of the page, add a template :
Name :
rtmedia
Open :
<ul class='rtmedia-list rtmedia-list-media'>
Item :<li class="rtmedia-list-item"> <a href="[+link_url+]"> <div class="rtmedia-item-thumbnail">[+thumbnail_content+]</div> <div class="rtmedia-item-title">[+title+]</div> </a> </li>Close :
</ul>Then save and choose from dropdown menu ‘rtmedia’ as ‘Markup Template’.
5/ In the gallery page add the mla shortcode :
[mla_gallery buddypress_urls=cover]I’m using some image attribute , so my shortcode is :
[mla_gallery buddypress_urls=cover tax_query="array( array( 'taxonomy' => 'rt_pays', 'field' => 'slug', 'terms' => 'france' ) )"]Thanks again.
Thanks for your update with kind words and the good news. Thank you as well for taking the time to post instructions for other rtMedia/MLA users to benefit from. It’s always easier to provide support when it becomes a team effort; thanks again for your help.
The topic ‘rtmedia and mla lightbox’ is closed to new replies.