Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Camptix Shortcode broken outside of pages #181

Open
tomjn opened this issue Jul 10, 2017 · 2 comments
Open

Camptix Shortcode broken outside of pages #181

tomjn opened this issue Jul 10, 2017 · 2 comments
Labels

Comments

@tomjn
Copy link

tomjn commented Jul 10, 2017

if ( ! is_page() || ! stristr( $post->post_content, '[camptix' ) )

I tried to go live with a WordCamp announcement post, but the camptix shortcode was only working on pages. I had it in a footer widget too, but that would only work on pages. Now I see why

If it's impossible to remove the is_page check, can we have a "Error: This shortcode only work on pages" message instead of "An error has occurred"

@tomjn tomjn added the bug label Jul 10, 2017
@tomjn tomjn changed the title Shortcode broken outside of pages Camptix Shortcode broken outside of pages Jul 10, 2017
@coreymckrill
Copy link
Contributor

@tomjn CampTix predates me by a lot, so I don't really know the reasoning behind limiting the shortcode to pages, but here's my take:

The way it's set up, the output of the shortcode changes depending on where in the ticket purchase flow you are. The relevant bit is here. So sometimes it includes a lot of content/markup/scripts/whatever, and sometimes it's fairly simple. Because of this variability, it doesn't work well to have that shortcode embedded in a sidebar or footer widget. And I'm guessing that the reason it only works on pages, and not posts, is just a semantic thing. Ticket checkout and payment are things you usually find on a static page somewhere, not in a blog post that has a context within a chronologic timeline.

If the architecture of CampTix was different, perhaps it would be possible and make sense to be able to embed a "Buy Ticket" widget anywhere. But again, this is just my take.

@tomjn
Copy link
Author

tomjn commented Jul 12, 2017

If we had an option that let you pick the tickets page then all ticket forms would submit there and the form flow would work regardless of where it started!

For now I've used a link to the tickets page with special styling, but the shrotcodes error message could do with mentioning it only works on pages

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants