Thanks for taking the time to share a possible solution.
I have been looking at Custom Request but I cannot figure out how it can generate a new Resource using a field name (siteid) from a database field
I tried to create a custom request with:
Configuration name = Site
Alias Path = Blank
Resource = site
URI Parameter = [“siteid”]
However this did not generate a new resource (maybe I did something wrong here)
I’m not so bothered about FURL’s, so if there is any available method of achieving generation of a resource (new web page) I would definitely like to try it
I may be out of place, but resources are a special thing in Modx. They are pages, if needed, but also serve other functions, and are only one way to hold and store data.
I am not sure if custom url is only possible with a new resource, but I do want you to understand that data, lots of data, can be stored and updated without using resources. Also creating resources might not be easy to do, I don’t know. But I think you can consider what you really want, is the important thing the url, or is the new resource the critical piece?
Bruno he seems to want a custom url more than anything, created (I think) on CMP update. When he says resource (url) I think he cares only about url, not resource.
What I want to achieve is to dynamically create a resource (url) based on the saved data from one field:
It is the content in the “siteid” field that I would like to be used as a new url for a new page every time the database is updated via the CMP.
@jamesjazz, do you want the url to be specific (directly from siteid db table, I think you meant) or can it be random?
It would be strange to let MIGX do such a function, you may want a snippet with php that grabs the data and makes the url…but I am out of my league here so take it all with a grain of salt
“Can you explain, why you want to create a resource for every item in your db-table?”
Automation … Upon every update in the CMP there are a total of 79 fields in the schema, I want to create a URL in the resource tree for only one field in the db-table “siteid”. So upon every CMP update a new URL will be created in the resource tree. Each new resource url would be assigned to the same template
“Bruno he seems to want a custom url more than anything, created (I think) on CMP update. When he says resource (url) I think he cares only about url, not resource”
Yes, that is exactly what I am trying to do, create a single unique url on each CMP update
“@jamesjazz, do you want the url to be specific (directly from siteid db table, I think you meant) or can it be random?”
I want the url to be specific to the db field “siteid” only
“you may want a snippet with php that grabs the data and makes the url”
Yes that would work, a piece of code can grab the data from that field and create a url in the resource tree is exactly what I want. Below is the data base details: