Dynamic link to the latest archive month

Newbie here - just need a quick loop to generate a link that points to the current month’s archive (so this month would be something like <a href="/2022/05/">Current Month</a>

Hey Jeromy, welcome to the L&L community! :smile:

That seems like a perfect opportunity to use the Date tag. You can read more about that here, but I’m pretty sure the following markup would give you exactly what you’re looking for.

<a href="{Date format='/Y/m/'}">Current Month</a>

Since you mentioned that you were a newbie, you may find this getting started guide useful if you’re interested in learning a bit more about the syntax of L&L.

By the way, it’s generally considered good forum/support etiquette to share some info about what you’ve tried so far, how you think you’d approach what you’re trying to do, etc. I’m always happy to help a newbie (speaking as a very recent newbie myself haha), but it’s always good to show you’ve put some effort into solving your own problem before asking others to help you solve it.

I hope this allows you to get started with L&L!

Holy moly just saw this. Thanks Benjamin! What a great response. I’m working on a fairly urgent project doing 100 things at once so I just punted. I didn’t see it immediately in the documentation and did some searching for about 10 minutes before I said to myself “Self, someone smarter than you has already done this, just drop your pride and ask for help”. And then came you! I’ll give this a shot. What an incredible plugin

1 Like

Hahaha no worries, I get it! The current documentation is still a bit tough to navigate and works more as a reference than a convenient getting guide when you’re just getting started. We’re working on improving that to make the docs easier to use so that should make it a lot easier to find this kind of answer in the future. Best of luck with L&L!

Update, this is where I want to put the L&L code, am I able to do this? I’m using CMS Masters Content Composer plugin. This is a little shortcode block I’m editing

I’m guessing I can’t just randomly insert L&L shortcodes wherever I want?

Haha unfortunately not :stuck_out_tongue: Maybe one day other developers will allow you to write L&L markup inside their text fields! For now, that markup can only be parsed when it’s inside a template. That being said, it is possible to load an L&L template onto a page using the [template] shortcode. So if you’re comfortable with styling your button using regular CSS instead of using that button shortcode editor from your screenshot, you could then probably place that styled L&L template on your page using something like [template id=74].

Oh wait, my bad, I misread and thought you were asking about whether it was possible to add L&L markup to that text box, but you were asking whether it’s possible to use the [template] shortcode in the text box. I’m actually not sure, but it’s worth a shot!