List Manager Forum

Insert code in Detail Layout

User imsj 2015-02-17 18:55:40

Hi,
I would like to insert some code (html, php or js) in the Detail Layout. My pourpose is to show a web page into the modal popup. I create a "URL" field so I am able to show a "link" into the Detail popup (using ##URL## tag). To directly show the page content I need insert this URL in an iframe (e.g.) or use a php or js function. But if I put the command all the row will disappear on save. I tried to use the code view, but is the same, regardeless I put the ##URL## tag or whatever else. Is there a way to insert some code in the Detail Layout windows? Do you have any other suggestion to show a page in a modal popup (e.g. inserting some clickable code in a field)?
Thank you very much in advance.
cmc

Moonsoft support 2015-02-18 14:09:48

Hi,
when you insert some special tags at the editor like iframe, they are stripped (not only for listmanager, it happens also for other joomla contents).If you already have the url created and you can display it with ##URL##, you could manually add the iframe tag to the display view.

modules/mod_listmanager/tmpl/content.php

viewDetail function. Where you find last appearance of

contentHTML=contentHTML.replace.....

you already have the html content that will be inserted at the popup. So you could create an iframe just after that

contentHTML="youriframetag id='iframeID' src='"+contentHTML+"' closeiframe";

so the popup will display an iframe with the proper source. You will need to create the id for the iframe, so you can force it to refresh for each popup. At the end of the same function, after setRated instruction, you'll need to add

LMJQ("#iframeID").reload();



Hope this helps, regards

User imsj 2015-02-19 13:19:20

Thank you very much for support.

I add this code starting from line 339 of /modules/mod_listmanager/tmpl/content.php

contentHTML=contentHTML.replace(new RegExp("{2}(.)*{2}", "g"), "");

// CMC ADD IFRAME CODE
contentHTML="iframe id='iframeID' src='"+contentHTML+"'/iframe";
// CMC END IFRAME CODE

LMJQ('#cb_detail').html(contentHTML);

iframe and /iframe have the correct GT and LT tags, but if I put those tag the message editor windows will delete them...

but nothing happens... I continue to view the URL in Detaile Layout instead of iframe...

This is the test page:
http://ceraunavoltailcaffe.jomsite.it/list-manager/

Can you help me?
cmc

Edited by imsj - 19.02.2015 13:20

Edited by imsj - 19.02.2015 13:23

Moonsoft support 2015-02-19 13:54:31

Hi,

We checked your site and seems that there's a problem with line breaks, and all code added appears in one line and commented because first line added is a comment line. You should delete comment lines and try again.

Regards,

User imsj 2015-02-19 15:39:39

I don't know what happened, but I insert again lines break and now works fine.
Thank you for your support.
cmc

...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!