Questions: URLs that open specific popups; Links that launch local apps

Hi Sparklers, :wave:

I have a couple questions about what is possible to include in a URL link. I’d appreciate suggestions.

  1. Is it possible for a link to go to a page, scroll to a Layout Block location, and open a specific popup among multiple popups? That is something like, https://mypage.com/#Layout#popup (an illustration, not an active link).

I use some popups as overlays and want them opened within a specific background context. Thus, modal popup won’t work and auto-open works when only one popup. Is it possible to link to different popups that are at the same location? It seems one should be able to but how do I get the popup identifier?

  1. Can a link on a page open a local application?

Is there a mechanism (in Sparkle or code) that can launch a specific application–say, the SparkleApp–as a link from a browser/website? Sparkle provides options to launch some applications (mail, messaging, etc.). Can a website launch common locally installed applications (e.g., Calendar, Tasks, Notes, whatever) as a link from a website?

For example, suppose I know that when a specific page is open that visitors will want to record an appointment. If I know their calendar application, can a link open the app?

Without the link, one must exit the browser, locate the Calendar app on the smartphone/desktop, launch app, then return to the browser to reread the task–too many steps between and I forget, get distracted… (I’ll blame it on age :stuck_out_tongue_winking_eye:).

Doing this, it seems, could raise security concerns surely. But I wonder if it’s possible with client approval.

Any suggestions? Are there tricks for these?

Many thanks…

Firstly, there isn’t an option to open specific apps for the simple reason that the app would need to be installed on the user’s computer. Unfortunately, this is an unknown factor when designing a website.

When it comes to opening multiple popups with a single link, I would question whether this would be an ‘in-demand’ feature. I don’t know of any web development apps that would add this to their toolset - it wouldn’t represent a good user experience and could be quite confusing. The real point of a link is for users to get specific additional information, either by visiting a page, opening a popup, or sending a communication of some sort.

There are, of course, cumbersome ways in which you could achieve this if you felt it would be beneficial to users. For example, you could create duplicate pages that contain the specific popup you’re targeting. One page would be set as a normal page, presumably with a link to open the popup. whilst the other would be a page in which the popup would open automatically. Your links to that page on other pages would point to the auto popup version of the page, and would typically require you to add an anchor to the point in the page where the open popup will display. Normal navigation links, from say a menu, could be directed at the normal page with no automatic popup. Clearly, this will require a degree of accurate cross linking to ensure the correct version of the page displays based on the link origin. Personally, I would question the need for such a convoluted methodology. To me it would be far simple to direct visitors to the section of the page where the relevant content is displayed, and add a link to the popup near that content.

As usual, @francbrowne, your reply proved most informative. Much appreciated.

After a couple months of casual research and a few weeks puzzling over real practicalities, I had come close to concluding that these two actions were effectively impossible, and (possibly) unnecessary. But, before ceasing my query, I thought I’d ask the group for any insights.

Let me clarify some details because, although your generous response provided answers, it suggests I mis-conveyed my specific interest.

RE Popup Question:
I too had puzzled through to the multiple-page coordination possibility; but it’s convolutions had me feeling like I was jumping into a Matrix World. I quickly dialed the number to jump out–there are enough practical problems requiring my actions (and, no, there’s no plug in the back of my head, I checked :wink: ).

More seriously, my interest is to open one popup with one link, not multiple popups from a single link, as your reply addressed.

To illustrate (but this is not my specific issue): Think of my question involving a standard tabbed box with each tab activating a different overlaid popup (see image; borrowed from a Tab Widget example).

Tabbed table example

The usual practice is to open one popup automatically (Popup1 associated with Tab 1) and arrange that a click to another tab (Tab 2) closes Popup 1 while activating Popup 2. (This was an example in Sparkle Documentation but I cannot find it now.)

My question is analogous to the Tabbed box example, but using one link to land at the box/table with Tab 2 open rather than auto-opened Tab 1. Even more, a different link would land with Tab 3 open. The essential issue in my scenario is that the link(s) and the Tabbed Box are not in the same screen and the link could even be from a different page.

Your suggestion is essentially my solution presently—i.e., the tabbed box solution. However, I wondered if the click to get there and the click to activate a popup are both necessary. It seemed, in principle, it should be possible to do both in a single click if the popups can be uniquely identified. Sure, there are alternative solutions but why would they be necessary when all the information is present and activating the popup is the only issue?

That written, nevertheless, I can manage with two clicks. No worry. Thanks for confirming.

RE Open a Local Applicaiton Question:
Thanks.
Perhaps the solution would be more in the realm of a device app than a web page, or somehow tying into a browser “share” button. Either way, its beyond a web-paging issue.

Thanks again, @franc, for the thoughtful reply.

Unfortunately, the HTML language doesn’t support multiple actions on a single link. To achieve that would involve writing some javascript and possibly adding an event-listener function. It’s clearly beyond the scope of this forum to advise on code implementation, but if you wan’t to see that it is possible, copy the code below and paste it into an embed object on a blank page. Preview in a browser and click the link - you will see that it triggers two actions.

<button id="myButton">Click Me</button>

<script>
document.getElementById("myButton").addEventListener("click", function() {
    actionOne();
    actionTwo();
});

function actionOne() {
    alert("Action One executed");
}

function actionTwo() {
    alert("Action Two executed");
}
</script>

Of course, this wouldn’t be of any help in your use-case scenario because the javascript would be associated with the original page. Therefore, when directing to the new page, the second javascript function would be lost. This could be overcome through the use of query parameters in the URL of the page being linked to. You would then need another piece of javascript on the new page to detect these parameters and perform the actions accordingly. It can all get very complicated, so it’s probably best to ask your site visitors to make an additional click - better than you having sleepless nights trying to get your head around all this additional coding.

2 Likes

As always, @francbrowne you’ve gone well beyond the necessary and into the realm of exceptional.

I hadn’t connected it to the HTML two-action problem. I saw it (clearly incorrectly) as a single action. Thanks for straightening me out.