Code question in fields

Discussion in 'Subrion Open Source CMS Core' started by glassjames, Mar 1, 2013.

  1. glassjames

    glassjames New Member

    I am sure this may be a age old question however when i search for it only two post come up, so maybe not...

    I would like to be able to create an additional field when i am adding a item to my website so that I can insert Amazon Iframe code into it,, i created a field multiline textbox and insert it currently from the source view and it shows the amazon ad when i switch the view back but when i save, it strips the code out.... anyone know if this is even possible? is there a setting i can adjust so that i can input and use html and other code and force the system to use it rather than stripping it away? i do not want it just to be in a block on the side of the page, every entry i have will be unique and i want a different Amazon ad for each entry. thanks now for your time...
  2. Gleb_S.

    Gleb_S. Subrion Designer Staff Member

    Hello Jim!

    Subrion has safe HTML function that allows only youtube and vimeo iframes.

    To allow amazon iframes you should edit [subrion_folder]/includes/classes/ia.core.util.php file.

    Find the line:

    PHP:

    $config->set('URI.SafeIframeRegexp', '%^http://(www.youtube(?:-nocookie)?.com/embed/|player.vimeo.com/video/)%');
     
    Replace it with:

    PHP:

    $config->set('URI.SafeIframeRegexp', '%^http://(www.youtube(?:-nocookie)?.com/embed/|player.vimeo.com/video/|(.*)amazon.com/)%');
     
    Save the changes. That will allow to insert iframes from amazon.com domain.
    olairmarcos likes this.
  3. popey87

    popey87 Member

    Thanks Alex I needed this fix.
  4. Gleb_S.

    Gleb_S. Subrion Designer Staff Member

    Always at your service!

    Sorry for such a long waiting, I found this thread in my notes only yesterday.

Share This Page