Logo of SermonSpeaker Extension Claim

Login Form

Latest Sermons - Popup Player

More
4 years 7 months ago #4265 by James Cooper
In the latest sermons module it would be cool if, when clicking on the link, it would open the popup player instead of taking you to another page where the sermon is played. I'm not sure if this is already possible but, I tried everything I could think of to get it working.

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago - 4 years 7 months ago #4266 by Thomas Hunziker
You could do that by overriding the module output in your template. And then append "&tmpl=component&layout=popup" to the link and set it to open in a new window.

You can read more about overrides here: docs.joomla.org/Layout_Overrides_in_Joomla and docs.joomla.org/How_to_override_the_outp...rom_the_Joomla!_core

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.
Last edit: 4 years 7 months ago by Thomas Hunziker.

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #4268 by James Cooper
Thank you! I was able to get the pop up working on my local PC by changing your code in modules\mod_latestsermons\tmpl\default.php from this:

$link = JRoute::_('index.php?option=com_sermonspeaker&view=sermon&id='.$row->slug.'&Itemid='.$itemid);

to this:

$link = "popup=window.open('index.php/sermons/sermon/".$row->id."?layout=popup&tmpl=component')";

and then I added the $link to the onclick event of the href tag.

The only issue I'm running into is when I push this to my site it no longer works because the URL doesn't need the index.php appended to it. Is there a Joomla or PHP function I need to add so it knows when the URL does and doesn't need in the index.php appended? I know your popup created in the Sermons Listing works like this when the popup player is enabled.

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #4270 by Thomas Hunziker
Yeah, it's called JRoute::_(); B)

Do this instead:
$link = JRoute::_('index.php?option=com_sermonspeaker&view=sermon&tmpl=component&layout=popup&id='.$row->slug.'&Itemid='.$itemid);

And instead of directly changing the file /modules/mod_latestsermons/tmpl/default.php, copy it to /templates/your_template/html/mod_latestsermons/default.php and adjust it there. This way an update to the module will not overwrite your changes ;)

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #4271 by James Cooper

Thomas Hunziker wrote: Yeah, it's called JRoute::_(); B)

Do this instead:

$link = JRoute::_('index.php?option=com_sermonspeaker&view=sermon&tmpl=component&layout=popup&id='.$row->slug.'&Itemid='.$itemid);

And instead of directly changing the file /modules/mod_latestsermons/tmpl/default.php, copy it to /templates/your_template/html/mod_latestsermons/default.php and adjust it there. This way an update to the module will not overwrite your changes ;)


I did what you said and my code looks like this:
$link = JRoute::_('index.php?option=com_sermonspeaker&view=sermon&tmpl=component&layout=popup&id='.$row->slug.'&Itemid='.$itemid);
<a href="#" onclick="<?php echo $link; ?>">


When I click the link it doesn't take you to the popup player. You can see this on our homepage in the test region here - when you click one of the links under "Weekly Sermons". Keep in mind the audio files aren't really there but, the popup player should come up if it works correctly and just say, "File not Found". I think...

Please Log in or Create an account to join the conversation.

More
4 years 7 months ago #4272 by Thomas Hunziker
Sorry, missed the 'popup=window.open' part.
$link = JRoute::_('index.php?option=com_sermonspeaker&view=sermon&tmpl=component&layout=popup&id='.$row->slug.'&Itemid='.$itemid);
<a href="#" onclick="popup=window.open('<?php echo $link; ?>')">

That should work I think.

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.
The following user(s) said Thank You: James Cooper

Please Log in or Create an account to join the conversation.

Time to create page: 0.243 seconds
Powered by Kunena Forum