Events Made Easy Forums How do I … …use placeholders in curly brackets inside tags?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #63972
    Anonymous
    Inactive

    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?

    #63975
    Franky
    Keymaster

    Sorry, 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/2691880

    #63999
    Anonymous
    Inactive

    Thank 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.

    #64000
    Franky
    Keymaster

    I 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 …

    #64001
    Anonymous
    Inactive

    I 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.

    #64003
    Franky
    Keymaster

    I 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.

    #64007
    Franky
    Keymaster

    While 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.

    #64008
    Anonymous
    Inactive

    I admit that I haven’t fully understood what it will mean at the end but happy to help with testing a new feature/improvement 🙂

    #64009
    Franky
    Keymaster

    Well, it means but your initial example ‘[eme_if tag='#_IS_USER_IN_GROUP{Administrateurs,Party #_STARTDATE{Y}' value='1']‘
    will work 🙂

    #64010
    Anonymous
    Inactive

    Great, thank you already.

    #64014
    Anonymous
    Inactive

    Yes, it works! Wonderful! Thanks a lot.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top