Too long a title?

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

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

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
nef
Posts: 257
Joined: Fri Jun 01, 2007 2:56 am
Location: Aarhus, Denmark
Contact:

Too long a title?

Postby nef » Thu Nov 26, 2009 12:54 pm

Hi,
It looks like OJS is setting a limit for how many words you can use in your article title. Is that true? If so, why do you set a limit?
Kind Regards
Niels Erik

jmacgreg
Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am
Contact:

Re: Too long a title?

Postby jmacgreg » Wed Dec 02, 2009 1:48 pm

Hi Niels,

The HTML form may be setting a limit (which was probably chosen as a reasonable default), but you can change that by editing the relevant template file, in this case templates/author/submit/step2.tpl in OJS 2.2.x (step3.tpl for OJS 2.3.x). Try finding the textfield with id="title" in that file and extending the field's maxlength.

Cheers,
James

szmigieldesign
Posts: 30
Joined: Thu Aug 30, 2012 2:22 am
Location: PL

Re: Too long a title?

Postby szmigieldesign » Thu Jul 24, 2014 2:19 pm

Hello,

I've stumbled upon an article which title contains 480 characters which is out of OJS limit.

Will modifying .tpl files help or is there some hard-coded database-based limit that I should be aware of? If it's possible via .tpl files - can OJS developers point me to which templates should I modify please (eg. quick submit, editor view, etc.)?

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: Too long a title?

Postby asmecher » Thu Jul 24, 2014 3:55 pm

Hi szmigieldesign,

What version of OJS are you using? The details will vary.

Regards,
Alec Smecher
Public Knowledge Project Team

szmigieldesign
Posts: 30
Joined: Thu Aug 30, 2012 2:22 am
Location: PL

Re: Too long a title?

Postby szmigieldesign » Fri Jul 25, 2014 4:51 am

asmecher, I'm using the latest OJS - 2.4.4.1.

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: Too long a title?

Postby asmecher » Fri Jul 25, 2014 9:05 am

Hi szmigieldesign,

In that case, you can extend the template limits; the database uses a TEXT type (in MySQL) that will already handle long content.

Regards,
Alec Smecher
Public Knowledge Project Team

szmigieldesign
Posts: 30
Joined: Thu Aug 30, 2012 2:22 am
Location: PL

Re: Too long a title?

Postby szmigieldesign » Sat Jul 26, 2014 5:07 am

Thank you, asmecher. I'll do some research to find all templates with article title.

One last question - could you please confirm that in this OJS version all article title textfields have id="title" and it's unique title ID in all templates? Or do ID's vary from template to template, i.e. "title", "articleTitle", etc.?

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: Too long a title?

Postby asmecher » Mon Jul 28, 2014 11:43 am

Hi szmigieldesign,

As far as I can recall, the title field should be named consistently. If you're looking in the template files, the syntax for the input field will look like this:

Code: Select all

<input type="text" class="textField" name="title[{$formLocale|escape}]" id="title" value="{$title[$formLocale]|escape}" size="60" maxlength="255" />
Regards,
Alec Smecher
Public Knowledge Project Team

szmigieldesign
Posts: 30
Joined: Thu Aug 30, 2012 2:22 am
Location: PL

Re: Too long a title?

Postby szmigieldesign » Mon Aug 04, 2014 12:25 pm

Thank you for your help, asmecher.

It looks like there are plenty of advanced customization options on the smarty side! Too bad that modifying them makes upgrading OJS much harder.

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: Too long a title?

Postby asmecher » Tue Aug 05, 2014 8:16 am

Hi szmigieldesign,

There are numerous standard tools to help with this. For our own hosting, we use git; previously, we used diff/patch to manage modifications on upgrade. Either makes it easy to extract and re-apply modifications when upgrading code.

Regards,
Alec Smecher
Public Knowledge Project Team


Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 4 guests