• Resolved jbonlinea

    (@jbonlinea)


    Hi there,

    I would like to use wp-built in dashicon in L&L templates.

    I’ve set dashicon properly, and I can add it in any post/page content through a custom html bloc.

    However, in L&L template, it renders as an empty black contour square.

    Any guess ?

    All best ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @jbonlinea, I haven’t played around with dashicons in L&L yet myself, but I’d be happy to help figure out what’s going on here. To speed up the process, could you share the HTML block where you’re able to successfully display the icon as well as the L&L template that’s causing you issues?

    Just following up here to let you know that I’ve tested this with the latest version of L&L in both the Twenty Twenty-Three and Twenty Twenty-Four themes and I seem to be able to display the dashicons in both HTML and L&L.

    Any news here @jbonlinea? If it’s still not working for you even when you use the syntax in my screenshot above in L&L, maybe you can try testing this out on a staging site by deactivating other plugins and changing your theme to something default and reactivating things one at a time to see whether some other part of your site is causing this issue for you. The fact that I seem to be able to work with dashicons in L&L seems to suggest that this isn’t an L&L issue and is instead something else going on in your template or site.

    Thread Starter jbonlinea

    (@jbonlinea)

    Hi there,

    Thank you for investigating this issue.

    Basically in wp html block I do exactly like you, and in L&L my code is pretty simple :

    <Loop type=event id="{Field id /}">
      <span class="dashicons dashicons-email-alt"></span>
    <Shortcode>
     <h6>[eo_events p="<Field id />"]%start{l j F Y à H:i}{}% - %event_venue%[/eo_events]</h6>
      
      </Shortcode>
      </Loop>
    
    

    Here, the shortcode work as expected, but I do get a square like this in place of the dashicon : ?

    EDIT : hum, actually, if I use the L&L template in a wordpress shortcode block it works, but I use the L&L template in “custom layouts” plugin template (that I use to display search and filter results), and there it do not work !

    I have no clues why ??

    Regards

    • This reply was modified 12 months ago by jbonlinea.
    • This reply was modified 12 months ago by jbonlinea.

    If you just put <span class="dashicons dashicons-email-alt"></span> by itself in an L&L template and try displaying that, does that work or does it show a square? If it works, then that means this isn’t an issue with dashicons and is an issue with the rest of your template. If it still displays a square even when that’s all you have in your template, then you’ll want to try the troubleshooting tests I described above to see if there’s a conflict with some other plugin or theme on your site.

    If the dashicon works when it’s on its own but doesn’t work when it’s in your template, then you’ll want to troubleshoot the rest of your template. Looking at the loop in your template (<Loop type=event id="{Field id /}">) I’m assuming you intend to place this template on an event post and then you want to be able to display its fields, is that correct? If so, there’s no need for the loop, since L&L can just display fields from the current post in the base of the template. You can take a look at the getting started guide in the docs, specifically this part, for more info.

    I’m noticing a couple other potential issues in your template. First, you’ve got an h6 tag inside your shortcode tag, which I don’t think is supported. Be sure to use the syntax noted in the docs when working with shortcodes. Second, I noticed you’ve got a tag inside an attribute, in p="<Field id />". That might be fine in this case since I’m not sure how L&L would be interpreting dynamic parts of a shortcode, but you might try using the curly brace syntax or some of the other syntaxes noted on that docs page.

    So all that to say, test out this template to see if it works and if not, test everything I’ve explained above to see what the issue might be.

    <span class="dashicons dashicons-email-alt"></span>
    
    <h6>
      <Shortcode>
        [eo_events p="<Field id />"]%start{l j F Y à H:i}{}% - %event_venue%[/eo_events]
      </Shortcode>
    </h6>

    Or try this alternative shortcode syntax:

    <span class="dashicons dashicons-email-alt"></span>
    
    <h6>
      <Shortcode eo_events p="{Field id /}">
        %start{l j F Y à H:i}{}% - %event_venue%
      </Shortcode>
    </h6>

    hum, actually, if I use the L&L template in a wordpress shortcode block it works, but I use the L&L template in “custom layouts” plugin template (that I use to display search and filter results), and there it do not work !

    @jbonlinea

    So you have a dynamic Field id tag rendering inside a third-party shortcode rendering inside an L&L template rendering inside an L&L shortcode rendering inside a third-party “custom layouts” templating plugin block. Shortcodes in WordPress are known to go through some pretty sketchy text filters when rendering them so it sounds like there might just be too many layers of parsing and rendering and at some point along the way, things are getting broken. From the testing we’ve done so far, you seem to have determined that this isn’t an issue with L&L and is instead something happening with your custom layout plugin, so you’ll likely want to reach out to their support to resolve this. Realistically though, a better approach would be to simply cut down on the number of layers involved in your setup.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WP-Dashicon not working in L&L templates’ is closed to new replies.