Giving back to a community: FCKeditor - User styles in News module
Posted: Tue Feb 06, 2007 5:02 pm
As we've gotten so much out from this wonderful CMSMS project we would like to give something back to ya all.
We had a problem where no user styles could be given in News module by FCKeditor like you can when editing pages if styles are given in FCKeditor "styles" tab. This requires that you create template called "News" and attach stylesheets needed to it. We've tried this in CMSMS 1.0.4 News module (What ever version it is).
On News.module.php at very end before last "}"
add new function
On action.addarticle.php
on very beginning of file you find
Add
In same file change (around line 138)
to
On file action.editarticle.php at the beginning you find ..
Add
On same file around line 199 change
to
Tried it briefly and now the styles attached to Template called "News" are able to be selected also in news module. Hope it works for you.
Have fun,
Keijo
We had a problem where no user styles could be given in News module by FCKeditor like you can when editing pages if styles are given in FCKeditor "styles" tab. This requires that you create template called "News" and attach stylesheets needed to it. We've tried this in CMSMS 1.0.4 News module (What ever version it is).
On News.module.php at very end before last "}"
add new function
Code: Select all
/************ BO edit ***************/
function getStyleSheet()
{
global $gCms;
$templateops = & $gCms->GetTemplateOperations();
$alltemplates = $templateops->LoadTemplates();
if (count($alltemplates) > 0)
{
foreach ($alltemplates as $onetemplate)
{
if ($onetemplate->name == 'News')
$templateid = $onetemplate->id;
}
}
$stylesheet = '../stylesheet.php?templateid='.$templateid;
return $stylesheet;
}
/********************EO edit************************************/
on very beginning of file you find
Code: Select all
<?php
if (!isset($gCms)) exit;
Code: Select all
<?php
if (!isset($gCms)) exit;
/************ BO edit ***************/
$stylesheet = $this->getStyleSheet();
/****************EO edit ****************************/
Code: Select all
$this->smarty->assign('inputcontent', $this->CreateTextArea(true, $id, $content, 'content'));
$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
Code: Select all
$this->smarty->assign('inputcontent', $this->CreateTextArea(true, $id, $content, 'content','','','',$stylesheet));
$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', $stylesheet, '80', '3'));
Code: Select all
<?php
if (!isset($gCms)) exit;
Code: Select all
<?php
if (!isset($gCms)) exit;
/************ BO edit ***************/
$stylesheet = $this->getStyleSheet();
/**************EO edit*********************/
Code: Select all
$this->smarty->assign('inputcontent', $this->CreateTextArea(true, $id, $content, 'content'));
$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', '', '80', '3'));
Code: Select all
$this->smarty->assign('inputcontent', $this->CreateTextArea(true, $id, $content, 'content','','','',$stylesheet));
$this->smarty->assign('inputsummary', $this->CreateTextArea(true, $id, $summary, 'summary', '', '', '', $stylesheet, '80', '3'));
Have fun,
Keijo