OnContentPrepare Issue - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

OnContentPrepare Issue

MZ

Mr Zen

SP Page Builder 2 years ago

Hi guys - this is a bit of a weird one, so please bear with me...

We've created a few custom addons for SP Page Builder which call data from another component we've created (a tour management system). Users can drag a tour onto a page and set the ID for the tour to display information about that tour in a card format.

Works great most of the time - good work on SPPB.

However, when using SPPB's content plugin to use SPPB in a joomla article, we've noticed some strange behaviour...

We've tracked it down, bear with me... Here’s the chain of events:

  • 1 - Load page /blog/article-alias
  • 2 - Load article id = 20
  • 3 - Triggers onContentPrepare against article
  • 4 - SPPageBuilder content plugin receives event, sees we’re on an article page with SPPB content so loads the SPPageBuilder integration for it.
  • 5 - SPPageBuilder integration loads the Page including one of our custom addons set to display content from a tour (id 3).
  • 6 - Tour card loads our tour id = 3
  • 7 - Our Tour Model also triggers onContentPrepare against the tour description
  • 8 - SPPagebuilder content plugin receives the event, still sees the page itself is an article page and loads the SPPageBuilder integration for it.
  • 9 - SPPagebuilder integration loads the content for an article (id 3) and the content of that article ends up being cached instead of our tour description causing users to see the article on the tour pages until the cache expires.

We know this is a very edge case, and we've temporarily found a way to work around it, however, we think there is a way you can contextualise the onContentPrepare so that it only fires in context.

We think - if you could update the SPPB content plugin’s "onContentPrepare" method to use the $context parameter to determine the context of the plugin event, instead relying on the Joomla "option and view" request parameters, this would set the context globally to the request rather than using the $context of each event - it should fix our problem (and possibly some other very strange issues others might be having when creating their own addons for your system...)

Any assistance on this would be appreciated...

0
1 Answers
Toufiq
Toufiq
Accepted Answer
Senior Staff 2 years ago #121031

Hi there,

I appreciate you reaching out. I have read your questions. I think need to forward your query to our developer team & your query is custom support based. If you don't mind, in the meantime will you please read our support policy?

https://www.joomshaper.com/support-policy

-Thanks

0