solved JrEmbed place holder tag is not being rendered

sekeri
sekeri
@ilker
10 years ago
334 posts
I have created my own Articles module using Aparna. It works just fine except it does not render JrEmbed tags like

JrEmbed works fine for Blog or Page modules.

How can I enable this feature for my custom module?

Thanks..


updated by @ilker: 05/18/14 03:52:34AM
brian
@brian
10 years ago
10,148 posts
You have to modify your module's include.php file and add a listener for jrEmbed's "output_html" event - i.e. in your init:

jrCore_register_event_listener('jrEmbed', 'output_html', 'myModule_output_html_listener');

Then create the myModule_output_html_listener function:

function myModule_output_html_listener($_data, $_user, $_conf, $_args, $event)
{ if ($_data['module'] == 'myModule' && isset($_data['id'])) { // return what you want to embed... $_rt = array( 'item' => jrCore_db_get_item('myModule', $_data['id']) ); $_data['html'] = jrCore_parse_template('embed.tpl', $_rt, 'myModule'); } return $_data; }

Then just create myModule/templates/embed.tpl and make it be what you want.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
michael
@michael
10 years ago
7,715 posts
sekeri:
I have created my own Articles module using Aparna. It works just fine except it does not render JrEmbed tags like [jrEmbed module="jrAudio" id="1"]

JrEmbed works fine for Blog or Page modules.

How can I enable this feature for my custom module?

Thanks..



How are you outputting the saved data in your item_detail.tpl page? Is it the same as the way the blog outputs its saved data in its item_detail.tpl page?

The blog one looks like this:
{$item.blog_text|jrCore_format_string:$item.profile_quota_id}
sekeri
sekeri
@ilker
10 years ago
334 posts
It is like
{$item.article_body|jrCore_format_string:$item.profile_quota_id}

I will try what Brian offers and also check the other modules how it is handled there.
sekeri
sekeri
@ilker
10 years ago
334 posts
Can you please tell me how it is handled for jrPage or jrBlog modules? I can not find myModule_output_html_listener functions for them.
michael
@michael
10 years ago
7,715 posts
Brian is explaining how to convert your own embeded tags.

So if you have your own custom tag.

[myModule id=11] or other coming out in the item_detail.tpl page, the you will need to the technique he has above to change that into the desired output.

What is the tag that is coming out on the page?
sekeri
sekeri
@ilker
10 years ago
334 posts
brackets jrEmbed module="jrAudio" id="1" brackets


updated by @ilker: 04/16/14 04:01:37AM
sekeri
sekeri
@ilker
10 years ago
334 posts
This is same for Blog as well. You can check it here http://www.myguitarworkshop.info/spoonman/blog/6/here-is-my-blog

Audio List can not play the item when I click on the play button ( http://www.myguitarworkshop.info/spoonman/audio ) It gives an error message "Uncaught ReferenceError: jrCore_stream_url_error is not defined " --This issue is solved with the last updates

I did not change anything in Blog or Audio modules.
updated by @ilker: 04/16/14 04:42:32AM
brian
@brian
10 years ago
10,148 posts
sekeri:
Can you please tell me how it is handled for jrPage or jrBlog modules? I can not find myModule_output_html_listener functions for them.

Blogs and Pages are not supported by jrEmbed, thus you won't see an output_html event listener.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
brian:
Blogs and Pages are not supported by jrEmbed, thus you won't see an output_html event listener.

I am totally confused. On my local computer ( http://localhost:8080/jamroom/) I can embed audio files to pages and blogs I create using embed button in the editor menu selecting them from the popup list. But I can not do it on the server( http://www.myguitarworkshop.info). Actually, I can do it but they are not rendered in the page or blog.

If Blogs and Pages are not supported by jrEmbed how are the embedded audio items rendered on my localhost installation for pages and blogs?
brian
@brian
10 years ago
10,148 posts
I'm sorry - I think misunderstood you. Of course you can embed audio - what you cannot do is embed a blog post or a page instead ANOTHER blog post or page.

Have you made sure embed is allowed as a text formatter in your Core -> Quota Config?

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
I think you are right. It was like this;
(X) Allow HTML
(X) Convert @ Tags
(X) Make URLs Clickable
( ) Allow Smileys
( ) Convert Embed Tags
( ) Convert # Tags

and I have checked all of them. Then please check what happened http://www.myguitarworkshop.info/spoonman

And when I go again Core -> Quota Config it was not saved even if I had a success message about the save operation.

Sorry for spending so much of your time :(
brian
@brian
10 years ago
10,148 posts
You need to reload the audio module - you are missing templates. ACP -> Marketplace -> Tools -> Reload Modules and Skins.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
There is a "Purchase Licence" link instead of ReLoad button even if I have already purchased it.

I think I have defined my Marketplace Credentials correctly.
brian
@brian
10 years ago
10,148 posts
sekeri:
There is a "Purchase Licence" link instead of ReLoad button even if I have already purchased it.

I think I have defined my Marketplace Credentials correctly.

If you see "purchase license" then it means the audio module is not licensed for the email address you are using in the Marketplace - did you purchase it under a different email or account?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
No, I am always using the same email. I can see the purchased items under https://www.jamroom.net/foxycart/items
brian
@brian
10 years ago
10,148 posts
sekeri:
No, I am always using the same email. I can see the purchased items under https://www.jamroom.net/foxycart/items

Let me check it out and see what's up - be right back.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
10 years ago
10,148 posts
OK - just added the media bundle in - sorry about that - it should have been automatic, but for some reason every once in a while the purchases are created in foxycart but do not get added to the licenses table. I've got some debug in for that though as I've been trying to track down the issue, so I will check that out.

You should be able to reload now.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
I reloaded but the problem is still there. Please check the links below;

http://www.myguitarworkshop.info/profile
http://www.myguitarworkshop.info/spoonman
http://www.myguitarworkshop.info/admin/page

Can it be a write permission problem about the cache directory? But it was not like this until I tried to save Core -> Quota Config
brian
@brian
10 years ago
10,148 posts
Yeah - looks like a permission issue. Delete all the directories in data/cache and make sure the data/cache directory is writable by the web user.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sekeri
sekeri
@ilker
10 years ago
334 posts
That was what I had on my mind. I will do it and inform you. Thanks..
sekeri
sekeri
@ilker
10 years ago
334 posts
I have deleted all the directories in data/cache and made the data/cache directory writable again by the web user.

Now it works! Thank you Brian for your great support!
brian
@brian
10 years ago
10,148 posts
sekeri:
I have deleted all the directories in data/cache and made the data/cache directory writable again by the web user.

Now it works! Thank you Brian for your great support!

Awesome - glad to hear that.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags