Search

Hi,

I am trying to implement a way for users to request vinyl on my website that they would like me to play on my next podcast. For example, on the following page I would like to place a "Request" button on each of the rows containing vinyl information: http://www.shrimp.dj/vinyl/artist/sub-focus/

I have been trying to tinker with a form type system where the request button will submit the vinyl information via a form and post as an entry into a symphony section, but after hours of troubleshooting, that was not a success.

Is there a certain approach any of you recommend? I am not looking for a drafted out fix, but some help in the right direction would be great. Thank you!

Adam

Hi Adam,

I think it would go something like this:

  1. Create a section called, for example, Requests, that uses a Select Box Link field to your Tracks section (Name field)
  2. Create an event that uses your Requests section
  3. Read through the text that appears when you've created the event, and copy and paste the form markup as it is for now into the page template
  4. See the example XSLT below that you can modify as required, and merge with your new form as appropriate
  5. Go to this page in Symphony and attach the event (you'll need to do the same for any pages on which the request buttons will be available). The Tracks data source should be attached to this page, too.
  6. Go to the frontend page with the form, select a track and, in the words of The Chemical Brothers, "push the button".

This XSLT creates a select, but you can modify to create checkboxes instead so that you can have tracks listed.

<xsl:template match="/data">
    <form method="post" action="{$current-path}">
        <xsl:apply-templates select="/data/events/request"/> <!-- for error/validation notifications -->
        <xsl:apply-templates select="/data/tracks"/> <!-- see template below -->
        <button name="action[request]" type="submit">Send</button>
    </form>
</xsl:template>

<xsl:template match="/data/tracks[entry]">
    <label for="fields-track">Which track are you requesting?</label>
    <select id="fields-track" name="fields[track]">
        <option>Please select...</option>
        <xsl:apply-templates select="entry"/> <!-- see template below -->
    </select>
</xsl:template>

<xsl:template match="/data/tracks/entry">
    <option value="{@id}"><xsl:value-of select="name"/></option>
</xsl:template>

Unless there's a step I've forgotten, I think that should basically work.

Enjoying your Energetic mix so far. Will listen to some more while I work today - thanks!

David,

Thanks so much! I will give it a go and let you know if I have any questions. Thank you kindly again and thanks for giving one of my mixes a listen!

Please let me know if there are any tracks you'd like to hear in an upcoming mix.

Adam

I was able to get it working! Thanks for the help!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details