Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi,
is it possible to get help on how to integrate Sheetnode module with your own database. My objective is to load some custom data from e.g. MySQL database as soon as the sheet gets loaded.
A small example of how to actually inject random data to some cells from correct hook (_load?) would be more than helpful.
Comments
Comment #1
infojunkie CreditAttribution: infojunkie commentedYou can currently load values from the database using the following functions:
=ORG.DRUPAL.FIELD(field-name, [oid, entity-name])
to load a specific field value from an entity (e.g. node or user) given the entity's unique id.=ORG.DRUPAL.TOKEN(token, [oid, entity-name])
allows loading a token value from an entity, using the Token module.There is no function to load an arbitrary column from an arbitrary table using SQL for example.
Comment #2
theme CreditAttribution: theme commentedUnfortunately that didn't answer the question I had in mind.
Basically I'd like to inject PHP-code directly to the sheetnode.module file, most probably in sheetnode_load(?) hook which would statically set some cell data in the visible sheet.
What parameters/which datastructure need(s) to be set so that each time some user surfs to sheetnode it would have e.g. number 5.67 in cell A4?
Comment #3
infojunkie CreditAttribution: infojunkie commentedSheetnode has the concept of "templates", which act like the default value for a new spreadsheet. To create a template, create a new sheetnode and fill the "Save as template:" field with a name, which will be used to identify the template. Later, a user can click the "Sheetnode import from template" link (node/add/sheetnode_template) to choose to start a new spreadsheet from one of the available templates.
Does that help?
Comment #4
willhallonlineNo plans for external database integrations.