Hi Digitalin, thank you so much for the reply it was very helpful.
You are 100% correct, I was up last night until 3-4am trying to figure it out and the Struct plugin finally "clicked" in my brain!
My initial confusion was due to the fact I didn't completely understand how struct worked, but now it makes a lot more sense.
Like you said, I was able to accomplish what I needed with struct and bureaucracy alone!
The
%pageid% column was a huge piece of the puzzle.
The other huge piece I found was
filter: %%pageid%% = $ID$
The only issue I am having now, is an
error I am getting once I submit the bureacuracy form to create the new page.
Warning: preg_split() expects parameter 2 to be string, array given in parserutils.php on line 289
Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/inc/parserutils.php on line 289
In case this helps anyone else in the future, here is what I came up with (disclaimer: there might be mistakes, this isn't an exact copy paste of what I have, I quickly tried to simplify it just to show the concept):
Index Page:
---- struct table ----
schema: songs
cols: %title%, firstline
csv: 0
sort: %title%
----
Add Song Page:
Note: I use struct_field instead of struct_schema to have more control over required/optional fields.
<form>
action template templates:song "songs:@@songs.artist@@-@@songs.title@@"
struct_field "songs.artist"
struct_field "songs.title"
struct_field "songs.firstline"
struct_field "songs.audio1" !
struct_field "songs.lyrics" !
submit "Add Song"
</form>
Template:
Note: I don't have the audio1 in the cols, because in my schema, I have 3 audio fields in case they have multiple recordings. Then I just made the "audio1" "audio2" "audio3" the only visible in-page fields. So Depending on how my files they upload, they automatically show up at the top of the page. If no file is posted, there is no message or error shown which is nice.
===== @@songs.artist@@-@@songs.title@@ =====
---- struct table ----
schema: songs
cols: lyrics
filter: %%pageid%% = $ID$
csv: 0
----