Not logged in. · Lost password · Register

All posts by blaksky (2)

topic: Audio Library?  in the forum: General Help and Support Features and Functionality
blaksky #1
Member since Sep 2018 · 2 posts
Group memberships: Members
Show profile · Link to this post
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.
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"

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
topic: Audio Library?  in the forum: General Help and Support Features and Functionality
blaksky #2
Member since Sep 2018 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Audio Library?
Hello, just wanted to say a quick thank you in advance for reading.

The goal is to have a namespace where my users can upload their own songs/recordings (non-copyrighted) and lyrics in a structured way (in other words, where people don't have to use any syntax)

The desired result is to have an "index page" with a table showing the library with: artist - title - first line of lyrics.
This table needs to be sortable so the user can sort alphabetically by those headers. When they click on a song, it takes them to the page for that song.

So far I am attempting to find a solution with these plugins: struct, bureaucracy, pagemod, and sortablejs.

The main issue I am having difficulty overcoming is the "index" page.

I feel like the best solution would be to use the struct plugin to enter a row with all the data for one song e.g., "artist" - "title" - "first line of lyrics" - "full lyrics" - "audio file" - "page url"

I tried pagemod but it didn't work with uploading files.

The index page would only show "artist, title, first line" - which would link to the page for the respective song, where you could listen to the song, read the lyrics and see the artist name.

I can't figure out a way to make a struct entry, and also update the sortable "index" page that links to all the songs.

Example Upload
Artist: Hello
Title: World
First Line: The cake is a lie

I want the page to be = songs:hello-world

If the schema had a "page" field, is it possible to dynamically set that field to "songs:@@artist@@-@title@@"
when they submit the form?

Then the struct table on the index would have a working link ???

I have been scratching my head at the best way to do this! Any help would be appreciated!!!
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-10-19, 01:45:20 (UTC +02:00)