Looper Provider / Consumer Placeholder

Is there a best-practice way to insert a placeholder if the provider source count = null ?

Case example: A client portal (highly derivative of Vultr’s dashboard for now lol, don’t judge) powered by loopers. Posts power the client’s items, but in some or many cases the client will not have any posts to fill certain areas. I’d like to show a placeholder.

Side question specific to this project (so I don’t have to open another ticket)… there isn’t any way to display a looper unique to whoever’s logged in, is there…? I thought I could achieve that dynamically via the “authors” setting.

If no alternative exists, I can always just use extra categories but it’s… not as secure from client-to-client as I’d like lol.

image

Hello @Rule72,

Thanks for writing in!

1.) You can use the Looper Provider Output is Empty condition so that you can display the placeholder.

2.) To display a looper unique to whoever’s logged in, you will have to use the Looper Provider Query String and then dynamically use the {{dc:user:id}} dynamic content in your query string. Perhaps this video may give you an insight:

Best Regards.

1 Like

Oh thank awesomeness!

  1. Nicely done!

  2. I’ve implemented a category-based method of selecting which account sees what pages, but it means that I manually have to copy/adjust a template for each new portal client (not ideal nor sustainable). The fact that the looper functions are this flexible is… just amazing.

Functionally…

cat=“category_name”&author={{dc:user:id}}

…more or less solves what I need, pending fiddly bits.


Because of loopers, I’ve been able to cut out (for the most part, case-specific) plugins like:

  • Slider Revolution
  • Essential Grid
  • UberMenu

…and my sites have just been increasingly a breeze to make as a result. Thanks!

1 Like

Hi @Rule72,

Glad that it helps. Please let us know if you need any further help.

Thanks

I’m still fiddling to see if it works, will report back!

Pardon my dust… I tried to find the documentation via Google but there is a massive amount of stuff to wade through. How might one include an “and” argument for multiple categories in the query string, requiring both to be present? (Or is the reason I can’t find this that it isn’t a thing, because I need an array?)

category_name=cat-1,cat-2&author={{dc:user:id}}

Hi @Rule72,

You need to use the Query String in the following way, described in the given threads.


It might look like the following.

category__in%5B0%5D=5&category__in%5B1%5D=1&author={{dc:user:id}}

Thanks

1 Like

That solved it! Thanks!

Hi @Rule72,

You’re welcome! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.