SoundCloud integration

We now support SoundCloud as media. To be able to add a SoundCloud media page part, all you need is the track number. You can determine the track number by following these steps :

  • click on the share button
  • go to the "embed" tab
  • fetch the numeric code from the url


Once you have the track number you're good to go. Go to your page and add an audio page part!

Fresh installs work but what about existing projects?

Doctrine migrations to the rescue! So first thing to do is run:

app/console doctrine:migrations:diff

Ok, this should have created a migration file (in app/DoctrineMigrations) that looks something like this:

class Version20140217173745 extends AbstractMigration
    public function up(Schema $schema)
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
        $this->addSql("CREATE TABLE kuma_audio_page_parts (id BIGINT AUTO_INCREMENT NOT NULL, media_id BIGINT DEFAULT NULL, INDEX IDX_A30C548EEA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
        $this->addSql("ALTER TABLE kuma_audio_page_parts ADD CONSTRAINT FK_A30C548EEA9FDD75 FOREIGN KEY (media_id) REFERENCES kuma_media (id)");

    public function down(Schema $schema)
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
        $this->addSql("DROP TABLE kuma_audio_page_parts");

Now you're ready to apply the migration, so go ahead and execute:

app/console doctrine:migrations:migrate

To be able to select the audio page part from the page part combobox you will have to add some extra configuration. If you open up src/YourVendor/YourWebsiteBundle/Resources/config/pageparts/main.yml you'll see the listings from the page part combobox. Just add the following to the types :

- { name: Audio, class: Kunstmaan\MediaPagePartBundle\Entity\AudioPagePart }

Et voila! You're ready to go ahead and start using the new audio page parts... If you want you can add the same line to other page part configs as well.



Feel free to contact the author