How to Disable/Enable WYSIWYG editor in Magento 1.4 - magento

When entering code in CMS static block(possible page as well) and in this code there is empty DIV tags such us:
<div class="dropoff_button"></div>
The DIV tags will be gone next time you open the block to edit. it will look as this
without the div tags
...and saving again it modifies your code.
I think it something to do with the 'show/hide editor'. By default it goes into the WYSIWYG editor, so when updating static block i don't see any other solution than
1."hide the editor' by clicking 'show/hide editor'
2.delete the old code from the editor
3. get code that doesn't miss the DIVs
4. Merge new code with code in 3 in some other editing software than magento
5. paste result in the magento editor,
6. Save
Is this bug? What is your solution? Can i turn of WYSIWYG editor?

This may not be consider as an answer but it solved our problem. It turns out that the editor WYSIWYG can be disabled by completely or by default at Admin->System->Configuration. Under 'General Tab' there is 'Content Management' section and there you can set different modes for this editor.
In our case we set to "Disable by Default" so that any time we open static block it does not clean the code only if we choose by clicking "Show/Hide Editor"

The editor, whether in WYSIWYG or not, tries to clean up your code. You may notice that it also replaces all your newlines and indentation as well. This means that you cannot just freely enter HTML into the CMS editor w/o it interfering.
I have not found a simple way to trigger the CMS not to clean your code on the way into the database.
Hope that helps. Thanks,
Joe

You can allow specific tags into tinymce.
You just need to edit the settings var in /js/mage/adminhtml/wysiwyg/tiny_mce/setup.js and add the following line:
extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder|allowTransparency],style,script',
You can see more info about it at this other thread:
Magento - How to allow certain tags (iframe, embed) in Magento's CMS editor?
It works for me on Magento 1.6.

Related

Font-awesome codes overrided by toggle editor

I am editing an article and adding FontAwesome in it using Toggle Editor. I've found out that when I add the code using programmer view, it works fine. However, when I change to the designer view from the programmer view, the editor automatically edit the code like this:
Before:
After clicking "Toggle Editor":
It is quite inconvenient for me because I use the designer view to style the article frequently. Is there any solution for it?
You'll have to look into the allowed tags for the editor you're using.
In your case using JCK Editor - you can see this article on why it removes certain code
At first glance it appears there are whitelist & blacklists for some HTML. You'll probably be able to add your selectors to the whitelist and they will no longer get stripped.

Content of article not showing

I have a menu item that links to an article, I have the menu item shown in the page, but then the user clicks onto the link, it will only show the title of the article but not the content. I am not sure, what exactly is happening.
I checked the source of html, nope the content isnot there. although the content is there in the database. I ran the degbug mode, but it will give the correct article, only it wouldnt render the content.
One of the menu which was there from beginning acts as required but if I add any menuitems and article, I wont see the content.
I had this problem, this is what solved it (using Joomla 3.2):
Clicked Extensions -> Template Manager to go to 'Template Manager: Styles'
Clicked on the style being used by the pages that did not show content, for me 'yoo_master - Default'
Under the profiles Tab, in the Content section I changed 'System Output' to 'Yes'
Then page content started showing again.
If you have the Agressive cache enabled (Global Configuration > System) and the Cache plugin activated it might take a while before any changes will appear. Flush the cache (Maintainance > Clear Cache), and see if the content shows after that. Also some Template Frameworks (like T3) have their own cache layer which might prevent your content from showing up.
Otherwise there could be a problem in the template, rule that out by assigning the default Template.

CKEditor plugin rendering different in WYSIWYG and source mode

I'm starting to develop a plugin for CKEditor that needs to be used to insert some HTML snippets in a web page. This is done. Nonetheless I also need to include some special items when switching to WYSIWYG mode (e.g. something more or less similar to Show Blocks plugin, but not just using styles since I need some elements included in there). So my question is :
How could I include extra items or styles (e.g. to hide parts of the contents in WYSIWYG mode) in WYSIWYG view without altering HTML output ?
If someone could provide some information about a working (maybe simple) example, I'd also appreciate your help.
PS: If you need to know further details please ask, but for instance assume inserted raw HTML code is
<div class="xxx">Hello world !</div>
... but in WYSIWYG mode need to display a link on top of it that pops up an alert and toggles dotted border.
About injecting CSS classes in WYSIWYG mode, use addCss function.
About creating fake elements in WYSIWYG mode ... I think I can solve the problem using context menu instead.

I'm building a theme for tumblr and the {HasPages} doesn't seem to work properly

I've put the HTML draft of the theme so far, with minor CSS edits.
Currently I have all the block posts and everything else that's essential to a tumblr theme but I can't seem to get the {HasPages} block to work properly.
I've tested it on a different tumblr, also. There are pages created and I already have provided some basic CSS for it just in case. But there isn't anything showing up.
Has anyone has this problem and if so, is there a solution I'm missing? The code to display the pages is included.
{block:HasPages}
<ul>
<li>Home</li>
{block:Pages}<li>{Label}</li>{/block:Pages}
</ul>
{/block:HasPages}
Also, is this a valid web masters' question. I'm not sure.
I just had this issue: a link to a page I created didn't show up.
I solved this by checking off "Show a Link to this Page" in the Page options. To find this:
Go to tumblr.com.
In the top navigator click the gear. This is where the settings are.
On the side, click on the blog you want to customize.
A customize button should show up beside the name "Theme". Click on this button.
Now your blog will show up with a Customize panel. In the Customize panel there should be a Pages section. Click the Edit button beside the page and a window will pop up.
You can find the "Show a Link to this Page" option in this window.
Let me know if you need any clarification.
As far as I can see your code is right. Have you clicked the 'show a link to this page' checkbox, which is at the bottom of the page edit popup? I bet that's it... :)
I have also been having this problem. However, everything works correctly on my actual page, even though the theme editor does not appear to be aware of the block on my custom theme, nor does the theme preview seem to be aware of the pages tagged to show.
Have you tried saving your theme and checking the links on the live page?

Remove "componentheading" from homepage - Joomla!

I'm working on a site in Joomla! and on the homepage, at the top of the article, it comes up with a h1 of the website name. The pagesource says (Note it's not the article title.)
Any idea how to get rid of it?
Thanks,
Steph
You can set this h1 tag not to display via the Parameters - System section of your Menu Item Manager screen in administrator ... this page has a nice depiction of the steps.
It's so simple
Just do the following :
Login to the Joomla Administrator Interface
Go to the Menu Manager
Select your Menu
Select your Menu Item (Home Menu)
On the right hand, Click Parameters (System)—> and in the *Show Page Title—->*Just Select No.
That's all.
This is not the desired solution, since many people, (including myself) actually need to be able to Set/Override the page title (That Appears in the Browser’s Title bar), and setting Page Title to no here will also remove the functionality to Configure the Browser title (which is important for SEO among other things).
Anyway, I have searched and not been able to find a fully correct solution via CMS or PHP Code. The closest solution which is not fully perfect, but unlikely to cause significant (if any) negative effect on your site is through Javascript (Example is JQuery).
jQuery(document).ready( function($) {
$(‘.componentheading’).empty();
});
This can also be done is JS with no JQuery. When I find a better method of doing this I’ll let you know.This should actually be done by removing output from a template file.I don’t know which one yet. When I do, I’ll post it…
When setting the page title not to show in the menu item as stated in other answers, this will not stop the text entered in the page title box being used as the browser title, it will just stop it being shown in the page.
Using javascript to remove it is not a good idea.
1. It will only work for browsers with javascript enabled
2. Search engine spiders will still see it. As the component heading for articles is 'articles' by default it will see all your pages with the same h1 tag.
Just turn it off in the menu item and enter your browser title in the text box above.

Resources