Adding a new font in magento admin panel - css

we have list of fonts available in the text editor of magento using which we can create cms pages.I need to add a new font to that, is it possible.?

You can add the font options via the tiny_mce editor_template.js file:
File: js\tiny_mce\themes\advanced\editor_template.js
Variable: theme_advanced_fonts
Tinymce Config

Related

In Wordpress website, connecting to another web_based application

I want to create a page in word press website, that shows information from external DB by API. What should I do?
But other pages and theme are in the Wordpress database.
Thanks in Advance
Set up a custom template. It can contain all the custom code you need, such as the API to call the external database. You create a new template by copying and modifying the page.php file from your theme. Just remove the parts you don't want and at the top put your new template name in a comment line like this:
/* Template Name: External-DB-Page */
Save that to a file such as external_db.php, upload it to your theme or child theme directory and then in your functions.php you include the file by adding
require_once 'external_db.php';
This new template called "External-DB-Page" will now be a selection available when choosing a page template for any page in WordPress.

Wordpress - Adding TinyMCE on Frontend into jQuery UI widget

I'm creating a Wordpress App. It consists on using custom fields on custom type, for managing personal projects.
My issue: I want to add the admin editor (tinyMCE) on frontend. Considering that I can have many textareas that will begin TinyMCE editors. So, I used this code:
PHP (on theme functions.php):
// TINY-MCE EDITOR ON FRONTEND
add_filter('wp_head','add_tinymce_editor');
function add_tinymce_editor(){
wp_admin_css('thickbox');
wp_enqueue_script('wp-tinymce');
wp_enqueue_script('tinymce');
wp_enqueue_script('editor');
add_thickbox();
}
JS (on theme single-projects.php):
jQuery(document).ready(function(){
// EDITORS
tinyMCE.init({
mode : "specific_textareas",
theme : "simple",
editor_selector :"tinymce_enabled"
});
});
On JS I set the "editor_selector" with a Class for all textareas that will begin tinyMCE editors. I cannot assign a single ID for each textareas because these can be 4 or 5 or 6, or more!!!
HTML: (on theme single-projects.php):
<textarea name="new-task-description" id="new-task-description"
class="tinymce_enabled required"></textarea>
Each textarea is present on Jquery UI Accordions.
Now, my problem is, on Firebug (or browser console) I get this error:
tinyMCE is not defined
What's wrong?
thanks in advance!!!
With Wordpress 3.3 you can use wp_editor() which is a lot easier.
http://codex.wordpress.org/Function_Reference/wp_editor
The right way to include scripts is add_action('wp_enqueue_scripts', 'tinymce_editor');
If tinymce is not defined the file tiny_mce.js has not been loaded on the page. Make sure the file gets loaded eigther directly or with the means wordpress offers.

Using the WordPress TinyMCE in an HTML iframe for plugin

I have a WordPress plugin with settings page. On this settings page, the form to be submitted is loaded in an iframe. I wish to utilize the WordPress TinyMCE for a textarea in this form.
How do I achieve this? I can't really do it the way it is stated here (http://keighl.com/post/tinymce-in-wordpress-plugins/) since the form is present in an HTML file.
WORDPRESS 3.5 UPDATE BELOW
If you're using Wordpress version<3.0, you can use the post you referenced to, it's great.
If your wordpress version is above 3.0 (aka newer versions) you can't use the wp_tiny_mce function for the tiny_mce, because it's deprecated. You need the newer function, wp_editor, which you can read all about it in here:
http://codex.wordpress.org/Function_Reference/wp_editor
For you to use of the wp_editor function and other WP elements your iframe (the for now containing only html and not linked into wp), you need to make your the iframe html file a php file, and add a require function of wp-load.php file.
For example, if your iframe file is in your server's root folder with your wordpress install, all you need to do is to place the following in the top of your file:
<?php
require('./wp-load.php');
?>
//iframe html/php code here
After you do that you can use any wordpress function in your iframe, including the tiny_mce.
---- UPDATE ----
If you are using wordpress 3.5 or higher, the implement method has slightly changed. more information is right in this short tutorial

add multiple languages to tinymce in asp.net?

In our project we used tinymce from creating moxiecode tinymce dll.
I added fr.xml and fr.js files to related langs folder in tinymce folder.
And modified code like below in Language.aspx page which is in langs folder of imagemanager plugin in tinymce folder.
string langfr = "fr';
LanguagePack langPack = man.LangPack;
langPack.Load(this.MapPath(#"im/" + langfr + ".xml"));
Moxiecode.Manager.Utils.GroupCollection groups = langPack.Languages[langfr].Groups;
and modified "en" language selection to "fr".
Is this the right way to add another language to tinymce
I followed the above implementation like in the site
You can only have one langugage per editor instance. Each instance can get its own language-setting using a different tinymce configuration for each editor instance.

Why is style.css breaking my custom Wordpress theme?

I have a clean install of WP 3.0.1, installed through cPanel and have created a directory for my new theme at /wp-content/themes/mytheme.
With an empty directory, the theme does not appear in the theme manager of the WP backend (as expected). If I add any PHP files (e.g. "page.php"), a warning appears in the theme manager that "mytheme" is broken because there is no style.css (again, as expected). But when I add style.css to the directory, the warning disappears and my theme is nowhere to be found in the theme manager. What's going on here?
Inside your style.css file you have to make sure that you are calling the default settings which wordpress will pick up, if you open up the default theme 'twentyten/style.css'
you will see this at the top..
/*
Theme Name: Twenty Ten
Theme URI: http://wordpress.org/
Description: The 2010 theme for WordPress is stylish, bla bla bla
Author: the WordPress team
Version: 1.1
Tags: black, blue, white, two-columns, fixed-width, etc..etc..etc..
*/
this has all the information wordpress needs inorder to include that theme in your appearence section.
once you have this inside your 'Mytheme' folder it will show up in the theme section, if you create a small png file called 'screenshot.png' add this inside your MyTheme folder, this will show up as the thumbnail for that theme... again look inside the twentyten folder and see how the files are arranged, this will give you a better understanding of how wordpress themes are built...
best thing to do while creating a new theme from scratch is possibly creating a copy of the twentyten folder and edit out all the un-required elements..
that gives you a good building block to work against.
or if you want there are a few themes out their which are naked themes, meaning they have the bearbones of what a theme needs then you can built upon..

Resources