Jump to content

GUID Generator


justb3a
 Share

Recommended Posts

GUID Generator

Generate a globally unique identifier (GUID) for Inputfield Text.

Usage

For each instance of a text field the field settings will be extended. Navigate to Admin > Setup > Fields and edit the desired field. Click on the Input Tab and click on the "Generate GUID" area. It extends downwards and reveals a form to enable automatic GUID generation.

After having enabled GUID generation for a text field, edit a page which has a template containing this field. You'll see the field filled with a GUID.

field.png.c894c737fa61523251a60e22eb18f17d.png

page.png.5b9687d2035a3f6cf054f9b4769e7801.png

  • Like 14
Link to comment
Share on other sites

The company which I'm working for develops apps, too. And for one of them we need a little notification system. Just a little endpoint which returns json. The app saves all notes which have been sent to the user. To be able to identify which message has already been shown, we need a global identifier. 

The workflow is as follows:

  • Login PW Admin
  • add a new page, the "id" field will be populated with a GUID
  • fill in all other fields which should be sent
  • an endpoint returns json, for example something like the following
[
  {
   "id":"936DA01F-9ABD-4D9D-80C7-02AF85C822A8",
   "url":"https:\/\/domain.com\/endpoint\/notice1\/",
   ..
  },
 {
   "id":"A36DA01F-9ABD-4D9D-80C7-02AF85C822A8",
   "url":"https:\/\/domain.com\/endpoint\/notice2\/",
   ..
  }
]
  • as you can see, for each note there's a "detail" page which will return the actual message
  • if someone opens the app, it checks whether there are new notes and displays them
  • Like 7
Link to comment
Share on other sites

  • 1 year later...

@justb3a I want to somehow create a unique page-slug (page name) for certain pages.

Do you think your module could be tweaked (maybe with a hook or otherwise), to let authors create a unique page name, in page-edit mode? This would be awesome.

The reason behind it: I want to create content, where only people who have that URL have access to it, without the author having to create a login / user first. I know, this is commonly called "security by obscurity", but for our use-case that's enough.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...