Open andreascarfo opened 3 years ago
Hi, you can manually activate links to be displayed in a lightbox using SLB's slb_activate()
template tag. See SLB's Activation documentation for full details.
I can't understand how to use this function in html. Maybe I was not able to look in documentation.
Please do not create duplicate issues. You can add comments to existing tickets and they can be reopened if necessary.
Please provide more information on where and how you are attempting to use SLB. Your initial post said "out frome the main content", but your later post says you want to use it "in a html page".
Like any other function in WordPress, slb_activate()
can only run on a PHP page where WordPress is active, so standard HTML pages will not be supported by any WordPress functionality. If you are actually referring to a theme template page, please provide the template's code (in a code block for proper formatting), and I will take a look.
I was worry because you decided to close this issue without my consent, without solving the problem.
Anyway in my workspace I can build sections out from main content pages and I can add widget or other component. In my case I have to add some stupid HTML code that will be the same in all the pages with that template (it's not importat if this will be one page or many). So, it's not a variable, there is not any Wordpress functionality, but only some stupid HTML code.
In other plugins I can specify a selector (id or class) to activate the lightbox. Other ones can...
<section id="expanded">
<div>
<a href="https://www.erraredesign.it/wp-content/uploads/ErrareDesign-EcoFactory_noteplant_08-2143.jpg" class="mylbox" style="">
<img loading="lazy" class="alignleft size-medium wp-image-200 mwl-img"
src="https://www.erraredesign.it/wp-content/uploads/ErrareDesign-EcoFactory_noteplant_08-2143-267x400.jpg"
alt="" srcset="https://www.erraredesign.it/wp-content/uploads/ErrareDesign-EcoFactory_noteplant_08-2143-267x400.jpg 267w, https://www.erraredesign.it/wp-content/uploads/ErrareDesign-EcoFactory_noteplant_08-2143-768x1152.jpg 768w, https://www.erraredesign.it/wp-content/uploads/ErrareDesign-EcoFactory_noteplant_08-2143.jpg 853w" sizes="(max-width: 267px) 100vw, 267px"
data-mwl-img-id="200" mwl-index="1" width="267" height="400">
</a>
</div>
</section>
In this case I used the class "mylbox" as activation selector.
If this feature will be created I will be happy to go back and use SLB.
Thanks in advance.
The ticket was closed because the question was answered based on the information provided in the original post. Providing all necessary information is the best way to ensure your actual question is answered before a ticket is closed.
Can you please clarify what you mean by "workspace"? Is the HTML code added to a template in the WordPress theme, or somewhere else (e.g. via a plugin, etc.)?
Thanks.
When I say workspace I mean Gantry5. It is workspace that came with a plugin, a theme and a child theme. In the backend the workspace ambient is opened inside a plugin area, not in the defult wordpress aspect area. You can give a look here http://docs.gantry.org/gantry5/configure/gantry-admin
Thank you for the additional information. What specific section of the Gantry admin you adding the HTML? If Gantry supports filters, it may be possible to activate links in HTML added to Gantry.
Also, please provide a link to the specific theme you are using so that your setup can be more closely reproduced.
Thanks.
Hi,
Section is #g-expanded
Gantry support in HTML particle processing shortcodes and process twig.
None of them worked.
My theme in use is a child themo of helium
http://gantry.org/downloads
Link to direct download https://github.com/gantry/gantry5/releases/download/5.4.37/wordpress-tpl_g5_helium_v5.4.37.zip You need to install the gantry5 plugin https://github.com/gantry/gantry5/releases/download/5.4.37/wordpress-pkg_gantry5_v5.4.37.zip
Thank you.
Thank you for the additional information. As Gantry uses Timber/Twig and generates its output differently than standard WordPress themes, making use of standard template tags is not as straightforward.
If you are familiar with Gantry's theme structure, you can use PHP's output buffering functionality to save the output of a specific component (such as your #g-expanded
section) and process it with template tags such as slb_activate()
before sending it to the browser.
I have also added looking into further compatibility with Gantry/Timber to the to-do list in the hope that a more native solution will be available in the future.
Description of Problem
On a homepage I'm inserting some photos out frome the main content and I'd like those photos to open in a lightbox.
I tryed to replicate the same code inside the main container of the page and the lightbox would work there.
But I would need to use more sections.
I enabled all options in "activation" options.
Details