• hey barry,
    first of all nice plugin, i use it with the free version of theeventscalendar.

    i use the event plugin only for the calendar, because of the lack of multiple events (even the pro version does not support manually entering many dates for one event). so i have to create a event for every new date which is not a big deal with the duplicate button (by the way: your duplicate button is not working good, all the extra fields and tags get not copied at all – i use Duplicate TEC Event Plugin which works quite better – maybe you check).

    my goal is to load the event dates that belong to one event into the blog post of the event (where you can also do the booking).

    the title of the post is the same as the title of every event entry (e.g. post title “wine workshop” and event title “wine workshop” “wine workshop” “wine workshop” is an post that includes 3 dates).

    the post has an own template and also the booking is created there.
    well, somehow i need the possibility to check via php if the event title is equal to the post title and put out dates with this condition.

    i tried a couple of things, but i simply cannot get it work.
    since the post title of the event entries are the same their permalink slugs are different (e.g. “wine-workshop” “wine-workshop-1” “wine-workshop-2”)

    the only solution i found is a bit complicated:
    1. i gave all event entries that belong together the same tag as the post title (here: “wine workshop”)
    2. since the tag is converted without spaces i check if the tag is equal to the slug of the post (because the permalink is set to /%postname%)
    3. i put out the dates of the events entries in a new line

    code result:
    <?php $slug = basename(get_permalink()); ?>
    <?php echo do_shortcode('[event_embed tag="'.$slug.'"]</br>{start_date}[/event_embed]');?>

    in the blog post “wine workshop” this puts out all the upcoming dates, when the workshop takes places.

    but it would be much much cooler to check directly if the blog post title is the same like the calendar post title. is that possible?
    regards
    thomas

    https://wordpress.org/plugins/event-rocket/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter telemarker

    (@telemarker)

    allright i got a new idea, here is what will do the trick also:
    since i redirect all dates to the blog post with a plugin. they all get the same permalink as the blogpost.

    now i just need a function to read the permalink of the event dates.
    i tried:
    <?php echo do_shortcode('[event_embed event="'.$slug.'" ]</br>{start_date}{url}[/event_embed]');?> and also
    <?php echo do_shortcode('[event_embed event="'.the_permalink.'" ]</br>{start_date}{url}[/event_embed]');?>
    but that won’t work at all, it would be cool to have something like:
    <?php echo do_shortcode('[event_embed link="'.the_permalink.'" ]</br>{start_date}{url}[/event_embed]');?>

    somehow the event= won’t accept slugs which is crazy since you tell everbody in the wiki that it works (so something is wrong here).
    the real question is probably: can you use placeholders {url} as a filter?
    all my best
    thomas

    Plugin Author Barry

    (@barryhughes-1)

    Hi Thomas,

    Event duplication will be much improved in the next release, however for various reasons I can’t make it available until The Events Calendar itself next updates.

    somehow the event= won’t accept slugs which is crazy since you tell everbody in the wiki that it works (so something is wrong here)

    Using slugs seems to work perfectly for me and so I’d need some concrete steps to replicate the problem, unless it’s local to your site/something else is amiss (such as the way you are populating the $slug variable).

    the real question is probably: can you use placeholders {url} as a filter?

    I’m not quite sure what you mean, but you can certainly define new placeholders and replace existing ones – and therefore modify the way they behave – if you need to, see here:

    https://github.com/barryhughes/event-rocket/wiki/Embedded-Events:-Inline-Templates

    Thread Starter telemarker

    (@telemarker)

    hey barry, thanks for reply.

    i mean not to use event=”[variable]” and filter events by this variable but use url=”[variable]” (like i put in the suggested code).

    regards
    thomas

    Plugin Author Barry

    (@barryhughes-1)

    I’m sorry but I am still unclear.

    Are you proposing a new feature, where the shortcode accepts a new parameter called link or url? I’m not sure I see the advantage of this over the existing event parameter.

    If you’re up for the challenge, though, you can effectively add new parameters via the following hook:

    eventrocket_embed_event_args

    Callbacks can access and modify the query arguments used to obtain events along with a list of any parameters passed to the shortcode, so it becomes possible to extend the shortcode in all kinds of new ways.

    If you can prototype something this way, I can then review it and see if it makes sense to add it.

    Right now though, I’m sorry – but I don’t understand precisely what you’re trying to achieve or why the existing facilities are inadequate.

    Thread Starter telemarker

    (@telemarker)

    hey barry maybe it helps to have a look at the site:
    http://www.weintante.de

    i have events as post (important: normal blog posts, not event post), because i like to describe multiple events with one post.
    http://weintante.de/das-kleine-wein-abc/

    the event post are only used for the calendar
    http://weintante.de/kalender/

    i have a licence for events calendar pro but i don’t run it on thewebsite since multiple dates aren’t supported yet and i don’t need all the other fancy stuff in the backend.

    further i run a plugin called “paged links to” where i can change the complete permalink of an event post (to redirect the from the calendar to the post).
    for example all of the 3 event posts “das kleine wein abc” are redirected to the blog post “das kleine wein abc” if you klick them in the calendar.

    as you can see i named the blog posts the same as the event posts.
    i like to achieve to get all the dates of an event into the blog post via php (the template of my theme is called template_single.php

    in this template i add underneath the line:
    <?php the_content(); ?>
    your pluginshortcode to load the dates when the event takes place.

    the sad thing with your plugin is now i cannot check the title of an event post and use it as a filter.
    for example:
    [event_embed event="das kleine wein abc"]</br>{start_date}[/event_embed]
    won’t work. also in my case
    [event_embed event="das-kleine-wein-abc"]</br>{start_date}[/event_embed]
    won’t work. which is weird (maybe because of redirecting the posts).

    a great solution would be to have a title (with spaces as a variable for the events =””)

    Thread Starter telemarker

    (@telemarker)

    the sad thing with your plugin is now i cannot check the title of an event post and use it as a filter (maybe because it’s bad to use spaces).
    for example:
    [event_embed event="das kleine wein abc"]</br>{start_date}[/event_embed]
    won’t work because spaces aren’t allowed. also in my case
    [event_embed event="das-kleine-wein-abc"]</br>{start_date}[/event_embed]
    won’t work. because even due redirecting the events posts to the blog post their permalinks won’t be changed internally (i tried to create the same permalink with a different plugin for the event and the blog post but the event post is shown every time and the blog post is not reachable anymore).
    [event_embed event="das-kleine-wein-abc-3"]</br>{start_date}[/event_embed] works, but don’t put out all the dates.

    the permalinks of the event posts aren’t the same like the permalinks than the blog post. thats why i put the permalink from the blog post as a tag in every event post that should be in the date list (works but my client has to fill in the tags – which can produce a failure).
    a great solution would be to have a title (with spaces as a variable for the events =””), but this is not the case. if the event=”” could be triggered by a title with space all would be good.
    then i could achieve everything directly with this line:
    [event_embed event="'.the_title().'"]</br>{start_date}[/event_embed]

    Plugin Author Barry

    (@barryhughes-1)

    a great solution would be to have a title (with spaces as a variable for the events =””)

    Hmm, I could consider this but I don’t want to offer any guarantees.

    For a number of reasons I’m reluctant to add it (not least WP_Query doesn’t appear to support this, unless I’m quite mistaken, so I’d have to take a different route) but certainly create a proposal on the issue tracker and then I won’t forget to take a proper look 🙂

    All in all it doesn’t really sound like Event Rocket is malfunctioning, rather it sounds to me as if it is operating as it is intended to – the issue is really that you’ve got something of an unusual use case.

    `

    Plugin Author Barry

    (@barryhughes-1)

    … Also, check out my 2nd reply: even if I decide not to add this functionality, the plugin is sufficiently extensible that you could add it and even share the solution with others 🙂

    Thread Starter telemarker

    (@telemarker)

    hey barry, yes i checked your reply but according to my understanding this extends the filter section not the how the variable event=”” is used.
    my task is surely unusual, that’s why i’m asking for help and advice.
    all of this would never have happened if the events calendar plugin would support multiple dates and not only recurring.

    another idea came into my mind. it would be enough to check if the slug of the blog post is part of the permalink of the event post.
    but i’m unsure if event=”[slug]” can listen to that and output the right thing.

    but of course the coolest thing will be to be able to listen to the posttitle, i’ll wait for this feature and got time, since i allready found a work-around with the tag.

    Plugin Author Barry

    (@barryhughes-1)

    Great 🙂

    A new release is due soon (once The Events Calendar 3.10 is released, so can Event Rocket 3.0 be released) – I’ll probably let that go out first and do any resulting clean up and then may start looking at new features and improvements.

    according to my understanding this extends the filter section not the how the variable event=”” is used.

    From that single point you can override the way Event Rocket handles existing shortcode attributes – like event – in addition to accepting new ones.

    If time allows I’ll try to write some examples.

    Thread Starter telemarker

    (@telemarker)

    thanks that would be cool

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘check if post title is included in event title’ is closed to new replies.