Forum Replies Created

Viewing 15 replies - 31 through 45 (of 72 total)
  • Thanks Ita! Glad to hear you’re happy with Loops & Logic and with the support we’re working hard to provide for this free plugin. If you’re interested, it would be awesome if you’d be willing to give the plugin a rating, we’re getting pretty close to a 5-star average rating it helps us spread the word about the plugin. If you’re not interested, that’s alright, don’t hesitate to post on the L&L forum if you need help with anything else ??

    Hi Ita, I’m glad to hear you’ve got that all working! I figured I’d chime in with a couple of pointers for you. Regarding your little template two posts up, you might try putting your text content outside the loop to make sure it doesn’t get repeated each time the loop runs in instances where a trainer works at multiple locations. Something like this on the trainer’s page:

    <p>
    The trainer <Field title /> works at the following locations: 
      <Loop type="rcvry-locatie" field="trainers_op_deze_locatie" field_compare="includes" field_value="{Field id}">
       <Field title /><If not last>, </If>
      </Loop>.
    </p>

    You can see how in this example instead of filtering my loop by nesting an If tag inside it (as you did in your template), I’ve instead used the field attribute. You can read more about the different ways of filtering the loop here. You also asked about how to make a ‘smart’ comma-separated list, so I’ve shown you how to do that in the example above with <If not last>, </If>.

    Hope that’s helpful, let me know if that works for you and whether you have any other questions! Also, since we’re sorta getting sidetracked from the original topic of this thread, you might want to post any additional questions on the community forum since there are more people with different skill sets that browse that forum and you might get better/faster answers.

    Hi Ita, you sure can! This is just down to how WordPress natively saves data. If you’re associating one post with another (like a location with a trainer, in your case), WordPress isn’t going to save all the data about the trainer alongside the location post since that would make WordPress’ database unnecessarily big. It just saves the post ID of the trainer and then you can use that to get more info about the trainer as necessary.

    If your trainers_at_this_location field is an ACF relationship field, then you could grab that with a relationship field loop like this:

    <Loop acf_relationship=trainers_at_this_location>
      <Field full_name />
    </Loop>

    If that data is created in some other way other than with ACF, you can do it in a slightly more ‘manual’ way like this where you’re passing Desiree’s ID number to the id parameter of a post loop for your trainer custom post type:

    <Loop type=trainer id="{Field trainers_at_this_location}">
      <Field full_name />
    </Loop>

    Hope that makes sense!

    Hi @itapronk! The first part of answering this is to figure out what makes the most sense regarding your data structure. That’s a question for the ACF forum and isn’t L&L-specific, since you can use L&L to loop through just about any data on your WordPress site. That being said, since you’re here, I’ll give it a shot to help provide some options.

    ACF has a relationship field, but the limitation is that it creates a one-way relationship between posts, not two-way as you’re suggesting you’d like. There’s some official documentation about setting up a two-way relationship field as well as ACF add-ons to enable that.

    The three approaches I see for you here are:

    1. Set up a bidirectional relationship field and then use L&L to loop through it. I’m not exactly sure how the data is saved in those types of relationship fields so you’ll have to do some tinkering, but you might try using the ACF relationship field loop syntax like <Loop acf_relationship=your_field_name> for starters. If that doesn’t work, you might try a field loop like <Loop field=your_field_name> or a post loop like <Loop type="locations,trainers" id="{Field your_field_name}">.
    2. If you can’t set up a bidirectional relationship field with ACF or some other tool, then you could probably still manage this using a regular one-way ACF relationship loop. Let’s say you set up a relationship field on your ‘locations’ post type called trainers_at_this_location. The Loops & Logic template on your locations post type would just be a standard acf_relationship loop (docs linked above). Then if you wanted to place an L&L template on the trainer’s page, you could use syntax like this, which only loops through locations where the trainers_at_this_location field includes the post ID of whatever current trainer you’re looking at: <Loop type=locations field=trainers_at_this_location field_compare=includes field_value="{Field id}">. This method involves the least additional work/setup/plugins but it might be a little bit trickier to understand what’s going on if you’re just starting out with L&L.
    3. The third way would just be to make two separate ACF relationship fields and loop through them with two separate acf_relationship loops (linked above). This is probably the easiest to visualize but would be more annoying for you to manage from a data entry perspective.

    Hope that’s helpful! If you ever get stuck or need more help, the Loops & Logic forum is a pretty active community and there are a lot more people that browse that who can help you compared to this WordPress forum, so you’ll probably get better/faster support there.

    Best of luck with building your template!

    It’s possible to render Loops & Logic templates either in pages built with Gutenberg, Elementor, or Beaver Builder or anywhere on your WordPress site that accepts shortcodes. Here’s an explanation of the different ways you can render a template. I’m not familiar with how MultiVendorX works and can’t guide you on implementing something with that particular plugin, but assuming that plugin allows you to add a template where you need it using any of the methods mentioned above, you should certainly be able to display your ACF fields using Loops & Logic. I hope that’s helpful!

    Hey Mark, good to hear from you again!

    Could you expand on what you mean by “the tags get stripped out for Tangible”? I’d be happy to look into this and get you some information about why this might be happening, but I’m not sure exactly what the issue is or how I could replicate it.

    I can say based on my general awareness of the development priorities that we’ve been approaching multisite compatibility carefully since we wouldn’t want an admin on one site to be able to access data from another. We’re working on a user permissions system that would allow us to better support multisite use, but this is still a distant priority.

    Let me know if you can provide any other info and I’ll look into your issue.

    Hi @baramagnus, great question! The syntax of CCS was built around shortcodes, but this limited the flexibility of the language and what people could do with it. L&L is way more flexible than CCS could ever be, but that meant moving away from a shortcode-based syntax that you can write directly into your builder. Here are a couple reasons for that switch. Since WordPress can’t natively understand L&L markup (unlike shortcodes), that means that L&L markup always needs to be written inside a template.

    Luckily, you can place your templates on a page using a shortcode if you’d like. Here’s an explanation of how to do that. There are a couple ways to display templates other than using shortcodes too so you can take a look at the different ways to place a template onto your page here.

    Hope that’s helpful, let me know if you have any other questions! Also, you might want to post your questions on the community forum next time since there are more people with different skill sets that browse that forum so you might get better/faster answers.

    Hi @chrisrixxo, I’m just chiming in here to let you know that I’ve passed the information along to a developer. I’ll follow up here with updates.

    If you think about what your template is doing, it’s checking the current post to see if there’s a certain taxonomy term applied. This works on a singular post page because the default loop context of the page is a single post. On an archive page, the default loop context is a whole bunch of posts, so there’s no way to check something about the “current” post at the base of the archive page loop. You’d need to set things up so that your template runs once per item in the archive loop (how you might do this will depend on the builder you use) or you could use Layouts in L&L to replace an entire archive page with an L&L template. For more info about loop context, you’ll want to read this page of the docs.

    By the way, you might get better/faster support about this kind of thing on the forum at discourse.tangible.one Since it’s a more active forum with people that have a variety of expertise.

    Hi @douglasmikado, thanks for the link to your site! I took some time to read through Polylang’s own documentation for media translations and it looks like both L&L and Polylang are working exactly as they’re designed to work. The issue here seems to be that you’ve enabled media translation, but you haven’t translated your media. Here are the steps to translate your media:

    1. Go to your site’s media library
    2. Click on the image you want to translate
    3. Click “Edit more details” at the bottom right of the modal window
    4. Click the plus icon in the languages meta box to translate the media into your other language

    You’ll then be able to display data in both languages. I hope my support efforts have been helpful for you and that you’re now able to get the most out of our plugin!

    By the way, I thought I’d mention that you might find the Loops & Logic forum to be a better place to get product support in the future. It’s a much more active community than this support in the WordPress plugin repository and there are people with a broader range of skill sets that can help you out with all sorts of things. Hope to see you on the forum!

    To clarify: if this is an issue between L&L and your caching plugin or some other third plugin that isn’t working as expected, we could definitely look into that. But from the sound of it, it seems that this issue is only happening when you try displaying data from Polylang, which suggests that the issue lies between Polylang and this other plugin/caching solution. We couldn’t provide support for an issue between two third-party plugins. Let me know if you have any other info that could help me replicate this on my fresh L&L+Polylang WordPress site!

    @douglasmikado I just enabled custom post/taxonomy translations on my test Polylang site and created some translated taxonomy terms. When I use the markup you shared in your most recent comment, everything works as expected and my loop only displays taxonomy terms that are in the same language as the post on which I’ve placed my L&L template. It sounds like you might have a caching configuration issue here that isn’t related to either Polylang or Loops & Logic, which we can’t provide support for, unfortunately. Are you able to replicate this on a fresh WordPress installation that doesn’t have any client-side or server-side caching? Does this issue still occur when you disable all plugins other than Loops & Logic and Polylang? Those might be helpful things to test to determine what’s actually causing this issue on your site.

    Hi @douglasmikado, you might want to take a look at the documentation for the attachment loop if you haven’t already. It lists all the fields that you can display in an attachment loop which are all the same fields you can display by appending things to that image_* attribute I mentioned in my previous post. If you scroll to the bottom you’ll see that the url field “Accepts optional attribute “size” for image size” so in practice that would look something like <img src="{Field image_url size=thumbnail}" /> if you wanted to use the thumbnail image size. You could also use any of the other default WordPress image sizes. Hope that helps!

    • This reply was modified 2 years, 5 months ago by Ben @ Team Tangible. Reason: fixed code formatting

    @douglasmikado Did you have a chance to look into the suggestions in my previous post? Let me know what you find out about potential conflicts with other plugins. My gut feeling is that neither L&L nor Polylang are the culprit here given that things are working for me on a fresh install with those two plugins. Let me know what comes up during your testing.

    Hi @polarracing, I’m following up on this issue before I close this thread based on your discussion with Eliot on the Tangible forum. It seems that this error is appearing because the code editor’s “linter” (which checks for correct syntax in L&L) doesn’t seem to know that <Shortcode some_shortcode /> is a self-closing tag. We’ll get rid of this unnecessary error message in the next update. For now though, it seems you (and anyone else experiencing this issue) could get rid of the error by writing out your syntax with an opening and closing tag, like <Shortcode some_shortcode></Shortcode>, but that’s not necessary if you’re happy to simply ignore the false error message instead. This is purely an issue with the code editor’s automatic check to see if you’ve made any syntax errors and isn’t an indication of an actual problem with your syntax. You could safely use the normal self-closing tag syntax and your template/shortcode should still work as expected.

Viewing 15 replies - 31 through 45 (of 72 total)