Moonsoft Software Solutions

Insert code in Detail Layout

Started 17 Feb 2015 · 4 replies

  1. imsj
    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
  2. Moonsoft support
    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
  3. imsj
    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
  4. Moonsoft support
    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,
  5. imsj
    I don't know what happened, but I insert again lines break and now works fine.
    Thank you for your support.
    cmc

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket