How to put an iframe inside a view on Drupal - drupal

I have a page on Drupal, and I need to put an embedded page that renders a 360 img, like an iframe, on a view:
I looked for it on the internet but have not found a solution. I created a tag on that view but I don't know where to put my iframe code to render it.
This is my config tag view:

I see you are using a body field in your view so I guess you'll want to add the iframe to that field?
If thats the case, you can enter the iframe code in your body and put the format on "FULL HTML", you might want to look into your WYSIWYG settings (/admin/config/content/formats in D8) to verify if the iframe tag is allowed.
There's also the option of using the iframe module (https://www.drupal.org/project/iframe) which allows you to add an iframe field.
Good luck

in my case, i create a block and i put the iframe code inside them, after i configure the block to show where i want
This is the creation block
But creating views, does not work because that don't let me modify the content

Related

Ghost blog popup halfway through article

I have a ghost blog and would like to popup a div element with content inside when the user scrolls halfway through each article.
How would i go about this? I can paste code into the code injection area where it says:
Site Header
Code here will be injected into the {{ghost_head}} tag on every page of the site
You can probably use the ghost_foot inside the code injection option if you want to inject the code into the body of the ghost blog.
If you want to add your code between <head>...</head> then use ghost_head inside the code injection.

Sitefinity cms related media link to document using custom field, not loading document path url

I am a beginner for sitefinity, so sorry for long post, not sure if its already answered, couldn't find out.
As working on sitefinity-8, looking for best option to select separate css while creating page each time.
I know, I can use different theme for different css, which will not work in my case, as we are having long list of css to use in whole site. Also I know, I can add css or any link into the head tag option of page properties or I can add css widget on the page itself to select css for that page only, but our requirement is to select css file while creating the page itself, this will make easy for novice editors too.
Basic thing I tried, to add css script tag into template, made it editable on page. So I can select css, but it exposes server folders, which is not ideal. Wish is there any way so that we can configure to select folder from sitefinity content- Documents & Files. But didn't find out a way to do so.
Other thing I tries, I have created custom field (related media-images, videos, files) for page to select a document & use as a link to add into head tag (to say link to add css for page.) With this custom field I can select needed document from appropriate folder from sitefinity backend itself, not from server. When I am looking into page source, I could see the link tag is there, but href attribute is empty. I also tried with adding related media tag into template the page is using, but the issue is same, no any value in href attribute.
Struggling to resolve this since long time, seeking for expert's advice.Thanks in advance.
The custom field path you've chosen should work - you will need a custom widget on the Page Template that will read the value of the custom field.
The GetRelatedItems extension method of the page node should give you the document object that was selected.
Having the document the widget will have to inject a link in the head of the page with the proper css attributes.

Drupal make block as a big link

i'm a completely new in Drupal. I'm building a website that in the home page has the typical 3 blocks on the button where you can click and go to some specific page or article.
I create that as Block and I even create that with Nodeblock, they are displayed in the right place and with the right text and images but what I can't make it work is make them be a big link, linked to their article or page, so when user will click it will be directly redirected to the main page.
Something like:
Block: discover
<div>Discover more about our last offer </div>
How can I do that?
I can't find anything close on the web...
Without seeing your site it's hard to say what the best course of action is, however I would suggest using the Views Module.
You could create a block with views and output any field as a link. In the Views UI you can set the url to link to any piece of content above it, using a token value. If you want to link to an item that is not visible, you can hide that field by selecting the "exclude from display" option in that field's settings.
You can also always use css to expand the size of the anchor tag to encompass the entire div.
Here is a tutorial:
https://www.youtube.com/watch?v=3L9JLZOb_LQ
in your block add
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.block-link').each(function(){
jQuery(this).parents('.block').slice('0,1').wrap('');
});
});
</script>

ckeditor doesn´t read media embed code

I use the media embed plugin for ckeditor. It works fine, the code is correctly saved in the database and youtube, soundcloud etd. players display ok on the page. But when the user goes to his administration, where he can edit the info, the text inside and with the tags is not showing, so when the user clicks on the save button, all previously saved iframes will be "erased" and only the rest of the formatted text will be saved. Is there any way to display the iframe code in the ckeditor?
I assume that you use CKEditor 4.1.x which comes with Advanced Content Filter (ACF). Most likely, the point is that you use different editors for frontend/backend editing.
Each plugin extends allowedContent property with own rules for tags, attributes and classes. Using those rules, editor automatically strips out undesired contents, so for example, if your fronted editor allows <iframe> because it has mediaembed plugin loaded, then your backend editor without this plugin will remove your <iframe> from the content.
Furthermore, ACF also observes your toolbar configuration so even if you include the plugin but you don't want the button in the toolbar, any content the button provides (i.e. <iframe>) will also be disallowed in editor's output.
You can easily check whether your editor accept <iframes>. Basically call the following and see the output:
CKEDITOR.instances.yourInstance.filter.check( 'iframe' );
>>> true // it's allowed
If it's false, then there are several solutions for your problem:
Enable mediaembed plugin in your backend editor (with button in the toolbar).
Extend config.extraAllowedContent to have it back again.
While the first solution is straightforward, the second one might be tricky for you. allowedContent rule for mediaembed plugin is as follows (see plugin's code):
allowedContent: 'iframe[*]' // stands for: iframe element with any attribute
If you add the following to your backend editor's config, you will have iframes back in your content without loading mediaembed plugin:
config.extraAllowedContent = 'iframe[*]'
If this solution doesn't work for you, please provide editor configs and CKEditor version so that people could help you.
CKEDITOR.config.allowedContent = true;
work for me.
To allow CKEditor to store custom HTML without it disappearing, you need to set the allowed content flag to true.
var allowedContent = true; // to allow custom html like iframe or div's
CKEDITOR.replace('yourEditorWindowsId', {
allowedContent
},

Drupal 6 adding iframe tag to content editor?

hi how would I added the iframe tag to the content editor? I have the input format set to Full HTML but still it does not allow the iframe tag.
Goto admin >> input formats, and add the iframe tag to Full HTML filter you're using for pages. That should do it.
To Clarify:
If in your list of filters you have "HTML Filter" Checked then you can manage the list of HTML tags.
However if you do not then you will need to check the filter on the wysiwyg editor you are using, so go to the config for they wysiwyg editor section you have installed.
In this link: http://web.maetschl.com/node/14
I use a iframe.. with full html, and works
<iframe src="http://web.example" width=700 height=700>

Resources