Events Made Easy › Forums › How do I … › …use placeholders in curly brackets inside tags?
- This topic has 10 replies, 2 voices, and was last updated 2 years, 8 months ago by Anonymous.
-
AuthorPosts
-
Wed 9 Mar 2022 at 22:19 #63972AnonymousInactive
Maybe it is not possible, then I would like to see it as a feature request.
The situation is that I use in a template an eme_if with the tag #_IS_USER_IN_GROUP{}, but I would like to make the group dependent of a variable like #_ATT{emegroupid} or #_STARTDATE{Y}.
When somebody registers for an event, this person will be added to a group and only this group’s members should be allowed to see a specific part of the event’s page.For example I tried something like ‘[eme_if tag='#_IS_USER_IN_GROUP{Administrateurs,Party #_STARTDATE{Y}' value='1']‘ but it doesn’t worked.
Any ideas how to accomplish that?
Thu 10 Mar 2022 at 09:44 #63975FrankyKeymasterSorry, but placeholders inside placeholders is a chicken-egg problem. I do take it into account if only 1 value is entered (not multiple groups), that might be considered a bug 🙂
Can you check if this helps:
http://plugins.trac.wordpress.org/changeset/2691880Mon 14 Mar 2022 at 12:52 #63999AnonymousInactiveThank you for carrying. Only on group wouldn’t be optimal in my case, but I might work around.
Nevertheless it doesn’t seem to work.I changed line by line.
I put myself in the group “Party 2022”.
If the code is
[eme_if tag='#_IS_USER_IN_GROUP{Party 2022}' value='1']
I can see the following text.
If I edit it to
[eme_if tag='#_IS_USER_IN_GROUP{Party #_STARTDATE{Y}}' value='1']
I can’t.I rechecked the changeset modifications in my eme_events.php and don’t think that I missed something.
Mon 14 Mar 2022 at 15:01 #64000FrankyKeymasterI tried it here, and while I *could* get it to work with placeholders inside the curly brackets (not now, needs extra code), it is not possible with curly brackets inside curly brackets. The parsing becomes a nightmare then …
Mon 14 Mar 2022 at 16:15 #64001AnonymousInactiveI can slightly imagine. What could be another solution?
Mabe the option to optionally assign a group to an event and a tag like #_IS_USER_IN_EVENTGROUP ?
I know that I can add users to a group while they register for an event, but this is different. For example I add every participant to the general Party Group but also to the specific year’s group. The event’s group would be only the group corresponding the specific year.
Then I thought I could do it with #_IS_REGISTERED and realized that I choose the is_user option because I want to have a section that also admins – that are not registered for an event – could see the part (for maintenance and such).
What about make #_IS_REGISTERED always also work for persons who are in an EME group called admins. Meaning EME admins have to create and fill this group if they want to use it that way.
Just some spontaneous ideas.
Tue 15 Mar 2022 at 00:42 #64003FrankyKeymasterI think I managed to implement a regex that better matches balanced curly brackets (one of the issues your usage was presenting me with) and after that also a better managing of using event placeholders inside generic placeholders (the other issue). Event placeholders inside event placeholders won’t be possible though …
If you want, I can commit that and you can then test the dev-version.Tue 15 Mar 2022 at 22:59 #64007FrankyKeymasterWhile I did not receive feedback, I tested the code a bit more and I’m ok with the outcome, so it’ll be in the next version.
Tue 15 Mar 2022 at 23:27 #64008AnonymousInactiveI admit that I haven’t fully understood what it will mean at the end but happy to help with testing a new feature/improvement 🙂
Wed 16 Mar 2022 at 07:31 #64009FrankyKeymasterWell, it means but your initial example ‘[eme_if tag='#_IS_USER_IN_GROUP{Administrateurs,Party #_STARTDATE{Y}' value='1']‘
will work 🙂Wed 16 Mar 2022 at 21:20 #64010AnonymousInactiveGreat, thank you already.
Sat 19 Mar 2022 at 13:52 #64014AnonymousInactiveYes, it works! Wonderful! Thanks a lot.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.