Reputation: 1
We want to create a custom home page and link to interior pages/plugins. It would basically act like a menu. We've been all through the documentation and looked at the sample plugins, but do not see a solution that works. We were sent here - https://github.com/BuildFire/sdk/wiki/How-to-use-Navigation - but there is not a working sample of the first item, and we've tried several ways to implement.
We've tried using the custom HTML plugin. It works great for the content and styling. However, the linking has not worked. Even a regular anchor tag with an href going to Google.com does not do anything.
We tried this:
var testLink = document.getElementById("testLink");
testLink.addEventListener('click', function() {
document.location('app1c99f8://plugin/2f83a24f-46b5-41f9-90e7-3b2e927a1998-1548869041425');
});
and this:
var pluginData = {
pluginId: "03dd5856-99ed-4950-ad40-6d95a29ef7f2",
instanceId: "03dd5856-99ed-4950-ad40-6d95a29ef7f2-1548863041993",
folderName: "",
title: "Hello World"
};
buildfire.navigation.navigateTo(pluginData);
I wanted to add a visual of what I'm trying to accomplish with the custom html plugin. You'll see the javascript suggested in the answer by Ayman within the first attached image. The second image shows the html used for testing purposes. Unfortunately none of this works and Daniel has mentioned we need this to be dynamic. Not sure how to do that either.
Upvotes: 0
Views: 156
Reputation: 56
to make it dynamic
steps:
https://github.com/BuildFire/sdk/wiki/Plugin-Instances#buildfireplugininstancesearchoptions-callback
from the results
var pluginData = {
pluginId: results[index].data._buildfire.pluginType.data,
instanceId: results[index].data.instanceId,
folderName: results[index].data._buildfire.pluginType.result[0].folderName,
title: results[index].data.title
};
buildfire.navigation.navigateTo(pluginData);
you can check this example for more details https://github.com/BuildFire/folderPlugin/blob/master/widget/index.html
Upvotes: 0
Reputation: 56
you need to pass the folder name, folder name is required
var pluginData = {
pluginId: "03dd5856-99ed-4950-ad40-6d95a29ef7f2",
instanceId: "03dd5856-99ed-4950-ad40-6d95a29ef7f2-1548863041993",
folderName: "61",
title: "Hello World"
};
buildfire.navigation.navigateTo(pluginData);
Upvotes: 0