Opening a TCMS pdf file in a Limelight Lightbox

Hi @tav. :-) Currently I am using this code inside a TCMS Blog Post to open a certain pdf (using the blogAuthor macro) file in a new window, which works just like it should (click here on the icon “Fahrplan” underneath the main content text: https://www.bingen-ruedesheimer.de/linienfahrten/linie/loreleyfahrt):

But it would be way better of course to open the pdf file in a LimeLight Lightbox. Even better than that just like I’ve done it on this page: https://www.bingen-ruedesheimer.de/fahrplan/ (click on one of the light grey boxes). Here Joes PDF Embed stack opens inside a Limelight lightbox, displaying a “hard-linked” pdf file.

In my example above since this is inside a Blog Post I would need to work with code, aargh…! I think I only would have to substitute the window.open (…….) part with some other code, but which…? Any hints for me? How would you do this?

Unfortunately it is a lot more complicated that just replacing the window.open() method.

If the PDF id being displayed by the pdfEmbed stack then you would need to have the block macro in the HTML for that iFrame (i.e. rather than the hard link in the stack settings). Opening the Limelight is just a click on a class name, this does not need to change dependent on the content of oEmbed.

The alternative would be to have a Limelight iFrame child that used TCMS macros rather than settings to specify the link (and I presume one that also JS’d the iframe size onto itself to make sure the content fitted - are we still talking about that content?)

Now, as you know, Limelight started its life 5 or 6 years ago as a TCMS lightbox called Snatchbox so we are almost coming full circle.

I could possibly make a new Limelight child stack but then again TCMS is on its last legs, soon to be replaced by TCMS2 which would render all the work pointless. I could also possibly make a special iFrame/pdf child that had the link within the HTML so that you could use a macro in there but we would (as above) need to scale the content.

1 Like

Thanks for your detailed answer, Andrew. What you’re writing makes indeed sense. I think I’ll have to either live with the current solution or will have to work on a different approach. Or simply wait for TCMS2. ;-) The client site (https://www.bingen-ruedesheimer.de) will be switched to TCMS2 anyway some time in autumn/winter, so my client will have to wait… :)

Hi Andrew, I made a bit progress with my little issue, but have a question:
I actually can open a certain, Blog-Post related Limelight lightbox with the class “lightbox-%blogTitle()%”.
For this I have to rename the Limelight ID for the lightbox to match the Blog Title. No problem so far, even working perfectly. As long as the Blog Title has spaces inside it… :-/
That said, a Blog Title like for example “Ringticket” works great (the LL unique ID for this is “lightbox-Ringticket”). But “Ringticket Bacharach” doesn’t work, probably because of the blank character (the unique LL ID for this would be lightbox-Ringticket Bacharach"). Since I cannot rename the Blog Title I have to look for a way that the blank gets interpreted correctly somehow.
Live example: if you go here https://www.bingen-ruedesheimer.de/linienfahrten/linie/ringticket---bacharach
and click on the small dot in the middle just above the blue footer you see that – which is a strange side-effect – the pdf from “Ringticket” is shown instead the correct one "Ringticket Bacharach).

https://www.bingen-ruedesheimer.de/linienfahrten/linie/burgenfahrt or
https://www.bingen-ruedesheimer.de/linienfahrten/linie/loreleyfahrt work just fine.

Any chance to make blanks work here? I already tried exchanging the blanks with   but without success…

That is really difficult. Limelight was designed especially to use class names so that it is easy to launch. Class names cannot have spaces and so your id of Ringticket Bacharach would just be interpreted as two separate classes of Ringticket and Bacharach. The former already exists in your other post and so it you will get the wrong thing in the lightbox.

Let me have a look and see if I can do something with just the stacks lightbox child.

I have to be very careful not to break it for everyone else though. The child id name entered gets used in many places including the other stacks such as the Limelight Bar so there is a large potential for me to mess things up.

1 Like

Tav if he used permalink instead of title, woud it work? permalink auto inserts - for spaces.

Thanks for your thoughts, Andrew.
“That is really difficult”… Yep, so it’s absolutely s.th. for you…! :-) Provided you don’t break anything regarding already existing instances of Limelight I would be glad for some solution. :)

Just notice that @Scott_Williams joined us. :-) A good idea, but what is the TCMS macro for “permalink”?

%blogPermalink()%

1 Like

Does that return the slug then rather than a qualified url? It would obviously need to do so in order to form a class name.

OK, I’ll re-phrase, it is not difficult, but it is complicated and interdependent.

%blogTitle()% = This Is My Title
%blogPermalink()% = This-Is-My-Title

;-)

2 Likes

Excellent - so the macro should really be called blogSlug then but the good news for @wolf is that it will work as a class name.

Is this sufficient then @wolf? can you use that?

2 Likes

Of course, thank you. How embarrassing… ;-)

1 Like

I’ll try, Tav. Will get back to you as soon as possible. Thanks so far both of you!!

@tav @Scott_Williams Just tried the permalink-solution from Scott. And what can I tell you…? It works! :-) (Already uploaded) So no need of making adjustments to Limelight, Andrew. I cannot thank you enough both for your help. THANKS SO MUCH! So now I can take the next steps and turn that silly dot into s.th. useful… :-)

1 Like