jonathanheilmann / ext-jh_magnificpopup

TYPO3 CMS Extension to integrate Magnific Popup
GNU General Public License v2.0
7 stars 13 forks source link

Multiple Instances on one page - content gets mixed up #39

Open dielf opened 8 years ago

dielf commented 8 years ago

We I have multiple instances of magnificpopup on the same page, the lightbox-content gets mixed up - e.g.: Lightbox 1 shows the content of lightbox 3, Lightbox 2 the content of lightbox 1 - somentimes, not always . In the Backend everything is linked correctly.

jonathanheilmann commented 8 years ago

Which TYPO3 CMS and jh_magnificpopup version do you use? I suggest, you are using the content element plugin? Some information about the plugin configuration may be useful:

I'd welcome a non working example, if possible.

dielf commented 8 years ago

Hi, thanks for your fast answer,

Yes, I´m using the content element plugin The Typo3-Version is 7.6.9 The Link Type is Image The Display Type is Content-Reference (tried inline as well) The acutal method is inline (tried ajax as well)

Examples: http://2016.auszeit-hh.de/unsere-zimmer/ This page works correct on some computers and/or browers, on others it doesn´t. Sometimes in both lightboxes the same content is shown - sometimes the content is correct. If I copy the link to the lightbox and open it in another tab, the right content is shown.

Another Example with Display-Type "Inline" and Method "Ajax" http://jak.de.dd25230.kasserver.com/index.php?id=2#seminare (click on "Mehr" > go to "Abendkurse" > "Das JAK Kursprogramm" > klick on one of the courses ("offenes Atelier etc..") )(sorry for that;-)) Each lightbox shows the same content.

Regards

jonathanheilmann commented 8 years ago

I assume, this is an caching issue. If I modify your html and add &no_cache=1 to each link, the matching content is opened. (The first link does not work, I used the second.) Du you use an extension to compress/cache your rendered pages? Maybe the query parameters of jh_magnificpopup are not respected an thus the first opened page is cached and tagged by query parameters id and type only?

dielf commented 8 years ago

Yes, it seems to be a caching issue. I don´t use any extension for caching - it works when I set config {no_cache = true ...} in TS.

jonathanheilmann commented 8 years ago

To just exclude the content in Magnific Popup from caching, you may add this line to your TypoScript setup:

ajaxcontent.config.no_cache = 1

I've never had this issue before and thus I'm a little bit unconfident on how to act due to this. I'll watch this issue, maybe you'll gain some more information or someone else has a hint on this.

dielf commented 8 years ago

This seems to work for me -tested it on the sites mentioned above. I will also test the plugin on some other sites with different Typo3 Versions and post my experiences here.

wenglor-IT commented 7 years ago

We have the same caching issue. To set the parameter ajaxcontent.config.no_cache = 1 resolved this caching issue.

But on our multilanguage site, the displayed Ajax content in the popup is in default language (englisch) each time..... the language of the content isn't correct !!!

Is there a solution?

jonathanheilmann commented 7 years ago

Again, do you have a non working example? As I'm not able to reproduce this error, I'll require a non working instance. Guessing the reason is sometimes really hard ;)

wenglor-IT commented 7 years ago

Here the example: https://www.wenglor.com/index.php?id=1176&L=1 image If you click one of the "video pictures", the popup is loading the each content with "ajax"method. With the parameter "ajaxcontent.config.no_cache = 1" the content is correct (no mixing), but the content is NOT in the right language version. Only the english (default language) is loading in the popup...

jonathanheilmann commented 7 years ago

That's a bug I'm going to fix. As I've no time left within the next days I'm going to try to provide a fix on Sunday.

wenglor-IT commented 7 years ago

Hello, can you estimate until when you can fix the bug?

jonathanheilmann commented 7 years ago

Sorry, I've missed to have a look at this issue.

After digging around in code, I'm not able to finde a bug, but an expected behavior like yours: If you do not set Field "Transl.Orig" in your references, the default language is displayed only. bildschirmfoto 2016-12-12 um 19 51 59 If you select the original Content Element in "Transl.Orig", the translated content is displayed. bildschirmfoto 2016-12-12 um 19 55 06

Maybe this solves your problem, @wenglor-IT?

wenglor-IT commented 7 years ago

Hello, we checked the records. Only the plugin itself was correctly localized. The sub-records in the plugin (text with image, etc.) were not created correctly. The sub-records were created as a copy, but also in the default language without reference to the original record. There is a bug with the localization in backend (creating localized sub-records) in your plugin (maybe only with T3 6.2.x ?). If you now change the language in the automatic created sub-records manually, you get the field for referencing to the original record and can make the correct reference here (as you have shown in your screenshot).

After this manual correction, the contents (languages) are displayed correctly in the popup.

There is no error in rendering the records in the frontend. But an error in the creation of the localized sub-records in the backend.

jonathanheilmann commented 7 years ago

Sorry for delay, I've been on vacation.

It's good, that manual correction works, but this shouldn't be the default way. I'm going to dig deeper into the code and what happens on translation