HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Modifying the News Editor

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#99029 (In Topic #19483)
Avatar

Fan in training

I would like to rearrange the items on the News Editor to better reflect the needs of our website. I assume there is no easy way to do this, but I need a bit of help here.

I'm having trouble locating the file that controls the layout of that page. My assumption is that the cms_news.php module is the file that controls the layout of the editor page. Am I correct, or am I in completely the wrong place?

On a related note, how can I change which fields are required? I'd like to make the primary news image a required field. I'd also like to change the default setting on the attachment uploader to make them NOT WYSIWYG editable by default.
Back to the top
 
Posted
Rating:
#99030

Honoured member

bstewart said

I would like to rearrange the items on the News Editor to better reflect the needs of our website. I assume there is no easy way to do this, but I need a bit of help here.

I'm having trouble locating the file that controls the layout of that page. My assumption is that the cms_news.php module is the file that controls the layout of the editor page. Am I correct, or am I in completely the wrong place?

On a related note, how can I change which fields are required? I'd like to make the primary news image a required field. I'd also like to change the default setting on the attachment uploader to make them NOT WYSIWYG editable by default.


I think you're looking for the

Code

NEWS_ENTRY_SCREEN.tpl
file, which is located in your "themes / default / templates" directory.  If you make any changes to the file be sure and save it to your "themes / default / templates_custom" directory.
Back to the top
 
Posted
Rating:
#99032
Avatar

Community saint

Making layout changes can be done via the templates as chipster has pointed out but as for making fields required that would likely need a little coding change.

Are you comfortable doing that sort of thing yourself? If you are then the file you mentioned sounds like the most logical place to start but might also require some edits in the sources folder too I am not sure. I could help look for you if you get lost.
Back to the top
 
Posted
Item has a rating of 5 (Liked by Chris GrahamLiked by JeanLiked by FletchLiked by Valkyrie)  
Rating:
#99035
Avatar

Community saint

bstewart said

I would like to rearrange the items on the News Editor to better reflect the needs of our website.
I assume by rearrange you just mean changing the order of the fields and not the layout. If so, then /cms/pages/modules/cms_news.php should be what you are after.

Fields appear in the order they are attached (i.e., look for ->attach) so you essentially just change the order that they appear in the code.

bstewart said

On a related note, how can I change which fields are required? I'd like to make the primary news image a required field.

To make image a required field, change:

Code

$fields->attach(form_input_upload(do_lang_tempcode('IMAGE'),do_lang_tempcode('DESCRIPTION_NEWS_IMAGE_OVERRIDE'),'file',false,$image));
to:

Code

$fields->attach(form_input_upload(do_lang_tempcode('IMAGE'),do_lang_tempcode('DESCRIPTION_NEWS_IMAGE_OVERRIDE'),'file',true,$image));

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: