Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DynPages plugin
#43
(2011-10-31, 04:13:25)alienee2 Wrote:
jyoz22 Wrote:
alienee2 Wrote:Hi -

I was wondering how to pass parameters to a component using the dynpages plugin;

i'm using an html5 player which uses this code for the player:

Code:
<audio class="AudioPlayerV1">
          <source type="audio/mpeg" src="/data/uploads/audio_file.mp3" />
          <source type="audio/ogg" src="/data/uploads/audio_file.ogg" />
    </audio>

so i set this up as a component and am loading it into the article with dynpages;

i would like to be able to put a placeholder where it says 'audio_file', so that i can use one component and then have it load different audio files by specifying the audio file name in the tag...

thanks in advance for any info on how to do this...i tried to read the instructions about using global arguments, but it seems to use php and since my component doesn't have any php i wasn't sure if this is possible..

Try this:

- Install the DynPages and I18N Custom Fields plugins.
- Go to the Plugins tab in Admin. Create a new custom field:

Name: music_file
Label: Music File
Type: Text field

- Create a theme component. Name it "music_player".
- Enter this for the component's code:

Code:
<audio class="AudioPlayerV1">
          <source type="audio/mpeg" src="/data/uploads/<?php get_custom_field('music_file'); ?>.mp3" />
          <source type="audio/ogg" src="/data/uploads/<?php get_custom_field('music_file'); ?>.ogg" />
</audio>

- Now when you create a page in GetSimple complete the custom field Music File with the filename's name excluding the extension (i.e., song1.mp3 would be "song1").
- In the WYSIWYG editor enter:

Code:
{% music_player %}

This should do it. I think. I haven't tried this I'm just following what I think would be a sequence that would work.

that's a very cool idea; though this would limit you to one audio track per page...thank you for the suggestion!

The plugin I installed are:
I18N 3.0.5 , Dynpages 0.7.2, I18N custom field 1.8.4

I create a component theme called "test" as follow:
<label for="name" label="" style=<?php get_custom_field('mylabel'); ?>>Name</label>

And I create a custom field like this:
Name: mylabel
Label: clear: left;float: left;padding:3px 10px 2px;text-align: right;width: 180px
Type: Long text field

In the WYSIWYG editor I enter this:
{% test %}

But I cannot see the formatting. The get_custom_field didn't work.
I need help
Thanks in advanced
Reply


Messages In This Thread
DynPages plugin - by mvlcek - 2011-01-21, 07:08:41
RE: DynPages plugin - Youtube - by stryker - 2013-02-07, 11:49:00
RE: DynPages plugin - Youtube - by mvlcek - 2013-02-07, 16:55:23
RE: DynPages plugin - by shawn_a - 2013-02-07, 12:53:35
RE: DynPages plugin - by stryker - 2013-02-07, 13:30:28
RE: DynPages plugin - by stryker - 2013-02-07, 18:55:07
RE: DynPages plugin - by shawn_a - 2013-04-29, 23:05:50
RE: DynPages plugin - by zintonio - 2013-04-30, 00:31:52
RE: DynPages plugin - by mvlcek - 2013-04-30, 02:20:28
RE: DynPages plugin - by eklassen - 2013-08-30, 23:20:18
RE: DynPages plugin - by Carlos - 2013-08-30, 23:36:35
RE: DynPages plugin - by eklassen - 2013-08-30, 23:53:25
RE: DynPages plugin - by Carlos - 2013-08-31, 00:46:28
RE: DynPages plugin - by eklassen - 2013-08-31, 00:51:40
RE: DynPages plugin - by Carlos - 2013-08-31, 02:10:30
RE: DynPages plugin - by shawn_a - 2013-08-31, 07:58:05
RE: DynPages plugin - by AndreiCurelaru - 2014-10-20, 02:36:38
RE: DynPages plugin - by mvlcek - 2014-10-20, 05:42:03
RE: DynPages plugin - by AndreiCurelaru - 2014-10-20, 06:11:04
RE: DynPages plugin - by AndreiCurelaru - 2014-10-20, 06:57:22
RE: DynPages plugin - by lnickel - 2014-11-25, 06:00:04
RE: DynPages plugin - by sal - 2014-11-25, 09:14:06
RE: DynPages plugin - by shawn_a - 2014-11-25, 10:56:41
RE: DynPages plugin - by Oleg06 - 2014-11-25, 17:51:24
RE: DynPages plugin - by sal - 2014-11-26, 09:12:08
RE: DynPages plugin - by shawn_a - 2015-01-07, 11:42:37
RE: DynPages plugin - by Didier9 - 2015-01-07, 12:55:35
RE: DynPages plugin - by Didier9 - 2015-01-07, 13:41:48
RE: DynPages plugin - by shawn_a - 2015-01-08, 00:00:54
RE: DynPages plugin - by Didier9 - 2015-01-08, 13:31:39
RE: DynPages plugin - by shawn_a - 2015-01-08, 13:46:26
RE: DynPages plugin - by Didier9 - 2015-01-09, 12:55:52
RE: DynPages plugin - by indyana - 2015-02-21, 13:33:11
RE: DynPages plugin - by wdburgdorf - 2015-06-04, 22:42:08
RE: DynPages plugin - by shawn_a - 2015-06-04, 23:25:14
RE: DynPages plugin - by linden - 2016-03-03, 22:02:49
RE: DynPages plugin - by mvlcek - 2016-03-18, 05:23:02
RE: DynPages plugin - by linden - 2016-03-15, 18:13:36
RE: DynPages plugin - by linden - 2016-03-24, 00:55:17
RE: DynPages plugin - by vanfruniken - 2016-12-01, 23:47:40
RE: DynPages plugin - by mvlcek - 2016-12-10, 04:13:23
RE: DynPages plugin - by vanfruniken - 2016-12-10, 06:59:26
RE: DynPages plugin - by pigsound - 2017-12-02, 17:40:52
RE: DynPages plugin - by tibbz - 2018-06-14, 13:42:13
RE: DynPages plugin - by leda - 2019-02-23, 21:03:08
RE: DynPages plugin - by Carlos - 2019-02-23, 21:40:59
RE: DynPages plugin - by leda - 2019-02-24, 08:34:50
RE: DynPages plugin - by AnthonyV - 2020-04-03, 08:43:40
RE: DynPages plugin - by pablito - 2020-05-02, 18:43:12
RE: DynPages plugin - by 0zz - 2023-01-03, 20:52:26
DynPages plugin - by Texta - 2011-03-06, 20:17:31
DynPages plugin - by ash - 2011-04-30, 06:21:52
DynPages plugin - by mvlcek - 2011-04-30, 16:35:48
DynPages plugin - by samrayner - 2011-05-26, 22:07:40
DynPages plugin - by andy1228 - 2011-05-26, 23:06:41
DynPages plugin - by mvlcek - 2011-05-26, 23:40:12
DynPages plugin - by polyfragmented - 2011-06-02, 01:40:14
DynPages plugin - by sal - 2011-06-02, 17:50:50
DynPages plugin - by mvlcek - 2011-06-02, 18:46:40
DynPages plugin - by sal - 2011-06-06, 14:35:32
DynPages plugin - by mvlcek - 2011-07-06, 05:30:06
DynPages plugin - by patriotmedia - 2011-08-09, 15:42:29
DynPages plugin - by polyfragmented - 2011-08-09, 18:19:01
DynPages plugin - by patriotmedia - 2011-08-09, 23:58:38
DynPages plugin - by alienee2 - 2011-10-30, 13:03:17
DynPages plugin - by jyoz22 - 2011-10-30, 13:22:51
DynPages plugin - by mvlcek - 2011-10-30, 17:34:58
DynPages plugin - by alienee2 - 2011-10-31, 00:10:01
DynPages plugin - by mvlcek - 2011-10-31, 00:18:24
DynPages plugin - by alienee2 - 2011-10-31, 02:45:57
DynPages plugin - by mvlcek - 2011-10-31, 02:54:54
DynPages plugin - by alienee2 - 2011-10-31, 03:32:37
DynPages plugin - by alienee2 - 2011-10-31, 04:13:25
RE: DynPages plugin - by zintonio - 2013-04-29, 18:56:29
DynPages plugin - by mvlcek - 2011-10-31, 04:34:53
DynPages plugin - by alienee2 - 2011-10-31, 04:58:32
DynPages plugin - by lbordas - 2012-02-02, 03:33:06
DynPages plugin - by mvlcek - 2012-02-02, 03:42:32
DynPages plugin - by lbordas - 2012-02-02, 04:35:20
DynPages plugin - by lbordas - 2012-02-02, 04:38:01
DynPages plugin - by ivobarbosa - 2012-02-09, 23:24:23
DynPages plugin - by mvlcek - 2012-02-09, 23:58:37
DynPages plugin - by ivobarbosa - 2012-02-10, 00:42:46
DynPages plugin - by Lars - 2012-07-09, 02:58:45
DynPages plugin - by shawn_a - 2012-07-09, 09:36:08
DynPages plugin - by trilbo - 2012-10-20, 01:56:46
DynPages plugin - by mvlcek - 2012-10-20, 02:35:15



Users browsing this thread: 2 Guest(s)