On my bicycle club website, I have set the following webpage, which serves as an anchor for a bike tour we organise. As it is, printing the page prints a different view of the screen page: it prints the cue-sheet participants will use, using the normal style sheet. This page exists already and is on line.
The page file name is "rallye_de_la_malmaison.html". The link to it is:
<https://www.abeille-cyclotourisme.fr/organisations/rallye_de_la_malmaison.html>
Not using a server-side language like PHP, but using javascript if needed, I want to also be able to use this page to print a flyer format A5 (two fliers would be printed from a single A4 page) describing this bike event. I have succeeded to prepare this flyer from my original page simply using an additional stylesheet ("styles_plaquette_rm.css").
On the current website, I have added a link called "Pub (A5)". On the example I have succeeded to prepare, clicking the link "Pub A5" opens a copy of the "rallye_de_la_malmaison.html" page, renamed as "rallye_de_la_malmaison_pub.html" and modified to the effect of containing a link to the additional stylesheet "styles_plaquette_rm.css".
This is a cheat, of course. I cheated because I do not know how to do what I want to do.
I would like my link to be scripted in such a way as to permit that, if I click the "Pub (A5)" link, it would point to the original page ref ("rallye_de_la_malmaison.html") instead of pointing to a modified version of the same page but, at a result of this scripted link, with, added in the subject page, the needed link to the additional stylesheet (<link rel="stylesheet" type="text/css" href="../styles_plaquette_rm.css">
)
I have looked at the precedent <Applying different Cascade Style Sheets to the same html page>. Unfortunately, it did not conclude on using javascript and therefore does not help, except it seems I have the same question, and it seems a solution may be possible.
Is my question clear enough ? Is this feasible not using PHP ? How ?