jDownloadsownloads.com


Author Topic: Plugins in Layouts ?  (Read 3164 times)

0 Members and 1 Guest are viewing this topic.

Offline Dode

  • jD Tester
  • *
  • Posts: 117
Plugins in Layouts ?
« on: 04.12.2011 21:03:24 »
Hello again,
I tried a quick search here but couldn't find an answer without hacking the code.

Is there a way to insert Plugins in the layout ? Ie. i want to include a MP3 player in the Files list using "JOSDewPlayer Plugin for Joomla", so i tried this code :
{play}images/jdownloads/mp3/{file_name}.mp3{/play}
But it's not taken into account.
Any idea ?

Offline Arno

  • Administrator
  • ***
  • Posts: 12.245
    • jDownloads.com
Re: Plugins in Layouts ?
« Reply #1 on: 05.12.2011 11:57:09 »
Hi.
Good Idea but not possible.
The player plugin can not know what for a file you mean.

Somewhere here in the forum exists a tutorial from a user to use a other player plugin.
Please use the search on the forums mainsite...
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline Dode

  • jD Tester
  • *
  • Posts: 117
Re: Plugins in Layouts ?
« Reply #2 on: 11.12.2011 00:06:05 »
Thanks Arno.
Actualy i saw the other subject to replace the original mp3 player, but what i want is to include a mp3/m4a/ogg player for any Donwloads (mostly WAV, FLAC, and AIFF audio files).

In the same way JDownloads allow for 3 images to be linked to a file, a way to "attach" other medias would be great (say a video, a pdf, whatever in fact). Perfect for e-commerce for example (provide a documentation, a sample, etc.).

I also tried with Javascript in the Layout, but it's not parsed.

Offline Dode

  • jD Tester
  • *
  • Posts: 117
Re: Plugins in Layouts ?
« Reply #3 on: 17.12.2011 16:12:26 »
I'm almost there !
Actually, Joomla plugins work in the Layout, i just forgot to activate them in the JDownloads backend configuration  ::) .
Now if i put the {play} (JosDewPlayer) plugin in there, it appears fine in the frontend.

The only thing i can't achieve is to retrieve the filename of the download, with or without the extension. How can i do this ? Something similar to the {screenshot} with just the filename would be great ! Example, i have a WAV file named thunder-rain-st.wav and a MP3 sample named thunder-rain-st.mp3 (or even thunder-rain-st.wav.mp3), id' like to show this in the Layout as :
{play}images/jdownloads/mp3/{filename_without_extension}.mp3{/play} or {play}images/jdownloads/mp3/{filename_with_extension}.mp3{/play}
Are you following me ?
If i can do this, i'll donate immediately (anyway i will even if i can't ;-) ).

Offline Arno

  • Administrator
  • ***
  • Posts: 12.245
    • jDownloads.com
Re: Plugins in Layouts ?
« Reply #4 on: 18.12.2011 11:43:43 »
Hi,
this placeholder {play} {/play} is used from the player plugin?
Then you must change the source code from the player plugin.
Contact the plugin developer for this...
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!

Offline Dode

  • jD Tester
  • *
  • Posts: 117
Re: Plugins in Layouts ?
« Reply #5 on: 18.12.2011 12:14:04 »
Yes, {play} is the placeholder for the JosDewPlayer plugin.
Actually there is no problem with the plugin, i just need to retrieve the strict filename of the download from JDownloads in the Layout so the player can know which mp3 to play.
I tested with other variables you provide (say {screenshot} for example) and it works fine with the plugin, but i need the strict filename only (preferably without extension) for the mp3...
Don't know if i've been clear enough, sorry ?

[Edit] It works if i put the MP3 in the images/jdownloads/screenshots directory and if the sample is named blabla.png.mp3. Then a simple :
{play}{screenshot}.mp3{/play} works fine.
I can live with that, even if i would have prefer to name the mp3 simply blabla.mp3 ;-) .
« Last Edit: 18.12.2011 12:47:34 by Dode »