View more context

 

nightjarnz

Well that should still be possible. You're looking for ArrayData

taoceanz

@nightjarnz I'm all good with the ArrayData & customise (I think). At a base, all I'm wanting to do is a check to see whether a variable exists in the view then display a section assuming it exists.

To give more context, I've created a footnotes include file that I'm displaying through a shortcode and pass a variable from the shortcode, through the shortcode handler function and is usable on the view that's being rendered.

If it were possible to check said variable in an 'if' statement, that should suffice for now.

E.G.

  1. [getfootnotestext footnotes='1,3,4']
  1. function getFootnotesText($footnotes){
  2. return new ArrayData(array_flip($footnotes));
  3. }
  1. <% if $footnotes.1 %> // display footnote 1
<% end_if %>
taoceanz

If 1, display 1. If 2, display 2.

Probably just get over this idea and create a new datatype.

Thanks for your feedback @nightjarnz

👍 (1)
nightjarnz

and ideally it should be a part of the shortcode handler, but the sounds.

Firesphere

Cool, so, my question wasn't clear, so I'll try again 🙂

Firesphere

Currently, when you're mentioning StripeSlackBot, in a public channel (e.g. here in general), it returns 1 search result and a link to the website

Firesphere

If you mention her with the keyword 'help', she will also send a help message on how to use the search

Firesphere

Now, instead of sending a message to the whole channel, would you prefer the bot to send replies to the mention (as in, start a thread), but keep the help message as a standard message?

Firesphere

Or, would you prefer the help message not be sent at all to public channels?

Firesphere

Or, would you prefer the responses to be send as a normal message instead of a reply?

Firesphere

Exception to option 1 is, if you mention the bot while you are already in a thread, the bot will always reply inside the thread with the search result