OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



TinyMCE Align Buttons

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

TinyMCE Align Buttons

Postby hekutoru2kx » Mon May 30, 2011 9:04 am

Hi everybody,

I was wondering if there is a way to add buttons to the tiny control to align any paragraph?. Everytime an article is added it needs to be aligned in its information. Is a hard work sometimes to check the tags manually or use a third software to do it. I want to know because sometimes if the data is copy from a text processor (like winword) it let a lot of dirty tags and I'd had some problems with it (like incomplete information shown).

I know there's a method to enable a default alignment in the style sheets. But that's only a default for one type of alignment. Let me know pleas, to know what to do.

Hekutoru2kx
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm

Re: TinyMCE Align Buttons

Postby ramon » Mon May 30, 2011 1:26 pm

Hello hekutoru2kx,

You can add extra fields according to TinyMCE specifications here.
You'll need to change plugins/generic/tinymce/TinyMCEPlugin.inc.php to add the specific buttons, according to the code provided by Moxicode.
Another options is to change the CSS to enable paragraphs to be justified by default, which would make more sense to me, as it will change all required paragraphs.

You may have to edit ojs2/templates/article/article.tpl, near line 80:
Code: Select all
<div>{$article->getLocalizedAbstract()|strip_unsafe_html|nl2br}</div>


You should add a class to the div, or modify that code to be a paragraph, although TinyMCE already adds paragraphs, so you have nested paragraphs on the variable.
I would recommend adding a class="abstract" at the div, and then on my CSS I would add the following rule:
Code: Select all
div.abstract p {
text-align:justify;
}


It's a simple modification, not too difficult to keep track of for future upgrades.
ramon
 
Posts: 929
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Re: TinyMCE Align Buttons

Postby hekutoru2kx » Tue May 31, 2011 2:20 pm

Thank you very much Ramon.

I chose to change the TinyMCE plugin to adapt it to our needs. Because, like I said, If I just change the style sheet then I still won't be able to select the desired alignment but the justify.

Plus, this option allows me to enable again the plugin option to auto clean paste. Option that was disable for the need.

Keep with the hard work,

Héctor J. Hernández R.
hekutoru2kx
 
Posts: 71
Joined: Wed Jul 28, 2010 12:47 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests