Generate a sub-page option

Hi all

I’ve been playing around with subpages and was wondering whether there was a hidden (or otherwise) formula that allowed you to generate a new subpage when you click a button?

More context: say I have a table of all the books I’ve read, and have a button I can click to add the books’ details (title, author, year published, edition, etc). I also want to make a subpage for each individual title.

Is it possible to get a sub-page to generate for each new title if I make a new record?

3 Likes

Hi @Charlie_M,
and welcome to Coda Community! :handshake:

Unfortunately, currently it’s not possible to create pages programmatically.
See also:

1 Like

Don’t mention N–tion. Coda has trouble acknowledging how much they ripped off, while also genuinely improving many things. It’s OK to acknowledge that there is a popular competitor while working hard to offer unique benefits (tables, formulas, much of the design surface). It’s also really not ripping off–all software borrows concepts. It would be impossible to make progress otherwise. In many cases there really are functional “pathways” that provide the best solution. Both N–tion and Coda are, at their cores, webpage generators. The only way we know to do that is with a canvas and widgets.

The hard part for the team seems to be conceding that the use cases for which Notion is currently superior actually are legitimate customer needs, which Coda can and should meet. They can also work hard to provide benefits. It’s not imitation; it’s progress. Sometimes they get flustered; they want so much to make things work and sometimes the workarounds don’t cut it.

Heads down; do the work.

HI Lewis,

I see that you have spent less than an hour on the forums reading up about Coda, so it is understandable that you are not up to date with developments done in the last year or so.

The post here that you have responded to, is more than two years old, and Coda has had some changes made to it in the period in-between.

Specifically on the topic of sub-pages, you now have two options. In the below document developing an “evolved” todo list, I showcase the two approaches.

In the case of meetings, which is generation 3 of the evolution, I use a canvas column on the task column to bring in a default meeting template.
In the case of projects, which is generation 4 in the document, I make use of the DuplicatePage() function to create a new project page based in the project type of the project that I am creating.

Coda has no problem with Notion, And I would assume that Notion has no problem with Coda. It is a big world, with room for many different approached to no-code.

Best Regards
Rambling Pete

I looked at the evolution. Good demonstrations. Good sense of humor. You are not the corporate type and yet, here you are…

Learned some things from the evolution of todo list:

  • OpenRow: is there an analogous way to open a view? My teeny notes Doc use row buttons to create the page and return its name (as link text, in effect) to the row and leaves the user (me) at the open new page. I’d rather have it leave me back at the table with its new row. Not to heavy a lift the user to click on the new doc. Problem with leaving user (me) at the new doc is the breadcrumb goes to the parent page (which is “Repository”). This is unappealing because the point of the table is to allow finding pages (docs in everyday parlance) and not to use the left-hand-side pane. Would OpenHyperlink() work? Would it work with a view name as the argument? Or must it be a URL? Coda doesn’t like telling us the URL to objects…
  • In the Projects stage of mankind’s evolution there is a “Projects Link to New Page” column. How could this show the “friendly name” of the page rather than the link? Seems like a DuplicatePage button in the row is the only way to populate a column value with the friendly link name to the page.
  • Buttons in rows vs buttons in the canvas, 2 questions:
    • As above, DuplicatePage row button seems to be only way to capture a link name to a new document. This would often be preferable as a canvas button with RunActions: create the page, populate the row. Why not make this possible?
    • Row buttons are odd creatures. It would seem natural to have the button ONLY apply to the current row, but you can set the context to be current, all, or filter. If the button is meant to alter/affect other rows, shouldn’t it be like a control associated with the table/view? Of course, there is a challenge setting the applicable row(s) but that could easily be done using a filter control.

I built my little notes doc initially using Canvas until I realized they can’t be printed or exported. For all the world Canvas is a page that can’t contain subpages, but can contain every other object. So, very useful. But, the canvas feature feels incomplete. It’s ok that features require evolution—a couple rounds of tweaks and improvements. These later efforts are much less than the first effort. So, printing and exporting.

So, I went back to using links to pages as a column in the notes table. 99% of the functionality; definitely harder to setup (but that is a one-time issue); a couple of extra steps for the non-technical user. Easy to print and export when the page is open. One liability I’ll point out is that the metadata in the notes table that pertains to each note row is not accessible in the note itself. This turns out to be a major advantage of N—tion’s row as page: all the columns associated with the note/page in the table are visible and editable in the page itself if you choose.

Also, why not make it possible to have a Canvas display option called “title”. Now we need 2 columns: inevitably a title column and the canvas column itself. You can sort of do it with preview option and wrapping turned off. Still, that’s not the same. Minor tweak.

You seem a constructively iconoclastic fellow. So, you’ve expressed the sensible attitude about N—tion or any other competitor. Seems, though, that the culture isn’t as open-minded. From an altitude as low as 50’, Notion and Coda are me-too products and Notion came first… There are certainly meaningful differences with advantages to each (no comment on where the weight of overall advantage lay—different folks will answer differently). It’s just a challenge to both differentiate with meaningful innovation and advantages, while also doing some unavoidable catch-up. There is a similar situation in spreadsheet-like online databases (I count at least 6 such products) and in configurable project management thingees. So, if the Coda family wants to at least try to grab the ring there is a lot still to do, including some catchup.

It’s early days so everyone’s growing, but those halcyon days won’t last forever. There are enough advantages—for me—to make Coda my choice. I express my frustration that a few small improvements around pages could seal it—for me. My concern is that Coda may not care as these page in table features are not on the path of differentiation that Coda wants to pursue—and it’s management’s choice to do as they see fit. No need to answer this last part—should be a separate thread and I am sure there are folks in “management” who get this—so, I drop it hereafter.

Now you can. It turns out that the DuplicatePage() function will work in a button on a canvas, not just for adding a row to a table that contains field that refers to a subpage.

Here is an example of a formula for a “New Note” button:

template.duplicatePage(
                Concatenate('new ',Now()), 
               Inbox)  

The trivial structure of this Note taking “app” is:

Doc: Notes
     page: Notes Folder
          * template is a hidden subpage
          * Inbox is a subpage of Notes Folder, 
            which is the only visible page in the doc Notes.

The button creates a new note in the Inbox folder entitled new + date-time. You can create more subpages in the Notes Folder for various topics. You can drag subpages that actually contain note content freely.

I am experimenting with the Doc Explorer pack to see if it’s a reasonable way to show all notes. Manually syncing is a bit inconvenient. I’d also like to reveal the hierarchy or at least filter on subpages that contain more than subpages. But, this is optional.

Piet, thanks for this–I’m finding it very helpful. I’m wondering how your Gen 4 Add a new project template button both creates a subpage (I assume through the duplicate page function) as well as modifies the row to add the link to the new project page. I am only seeing the option to do one action (duplicate page or modify row) from the no code options around the button. Would you be willing to share your code?

Thanks!

After digging, I found the solution, which is to embed the duplicatePage() action into the modifyRows action, eg

ModifyRows(thisRow, thisRow.[PageLink], DuplicatePage([Page Template], name: thisRow.Site, parentPage: [New Page]))