Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need Help – Im Building a Custom Component for Music

  • Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    I have quite a bit of my new component working. I can add music to my site and it will list in activity that I have done this. It will also load into a tab within my profile called music. I am now working on where the single music item will exist and cant seem to get my head wrapped around my issue.

    Groups Component – http://www.domain.com/groups
    A single group – http://www.domain.com/groups/groups-name

    My Music Component – http://www.domain.com/music
    A single music item – http://www.domain.com/music/music-name

    Im storing my music in a custom post type. I dont know if this is making things more difficult for me, but things are displaying correctly.

    At a minimum I need help getting my component to show a single music item (not the activity item).

    Thanks,
    Jesse

Viewing 8 replies - 1 through 8 (of 8 total)
  • Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    Well I finally got this working.

    I had to setup a main menu item with a position of -1 which had a sub menu item set to the post_name (slug) of the post I wanted to display. I then had to setup a screen function to display it and then a template file for the content.

    All is good to this point, but I have just realized it might make since to add in some the genre and other custom taxonomy into the URL for sorting and filtering the music buy genre and music type. I have two music types (tracks and mixes) currently saved as post meat, but could be converted to a custom taxonomy if it will allow for better filtering. And I have a custom taxonomy called genre.

    How could I add these into my URL so it would look like this,
    http://www.domain.com/music/track-or-mix/genre/music-title

    Any feedback or guidance would be awesome,
    Thanks,
    Jesse

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Did you create a component using BP api or are you just loading cpt in a tab?

    Avatar of mpa4hu
    mpa4hu
    Participant

    @mpa4hu

    I suggest looking inside Buddypress media

    here is already done what you trying to do, so hope it helps

    Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    When I found Buddypress Media I was 50% on the way to having my own custom component developed and it sounded impressive but… I was hoping for so much more and when i fell short. For starters, I have my own custom player for the site, couldnt tie into well, and playlists where hurting. Ill just stop there.

    I just decided to continue building my own so… back to my question. Trying to add in custom taxonomy and post meta into the URL.

    I used the buddypress skeleton component to build my music component. Id say its about 80% done now. Really just looking for help to getting custom taxonomy and possibly post meta into the music component url.

    Thanks,
    Jesse

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    There is a bit of disconnect from CPT and a component.

    check out Achievements plugin to see how you can create CPT that utilizes BP. BP component is more for an easy way to get activity streams, settings etc. It is not a requirement and sometimes is inappropriate.

    Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    I have my custom component working with a custom post type. I found the tutorials written for the development of bp-checkins quite helpful. Info for others needing info on how I accomplished this can be found in these files ExtendBuddyPress-part1.pdf and ExtendBuddyPress-part2-en.pdf.

    I looked into the achievements plugin but couldn’t find if or how they were using taxonomies in the url of a custom component.

    Ive been thinking it might be easier to use subnavs and actions to accomplish what I want.
    Using a URL like this:

    http://www.domain.com/music/type/mix

    or

    http://www.domain.com/music/genre/rock-n-roll

    Where music is my component, type/genre is my subnav slug and mix/rock-n-roll is my action.

    This would give me a way to create an archive page for mixes/rock-n-roll. I would use a negative value for the position so the subnav is not visible on subnav menu.

    Are there any side effects or things I should be concerned with when using this method, like how would I implement pagination of the results or how to keep someone from creating a music item that is the same name as the subnav slugs i am using.

    Thanks,
    Jesse

    Avatar of mpa4hu
    mpa4hu
    Participant

    @mpa4hu

    Are you willing to show us your work?

    Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    Im finally getting back to this issue. I dont mind sharing my code. What part do you need to see?

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.