Article previous html

From Redazione
Jump to navigation Jump to search
Line 285: Line 285:
 
$('form').submit(function() {
 
$('form').submit(function() {
  
  var type = $(this).find('[name="Form article[Type]"]').val()
+
  var type = $(this).find('[name="Form article[Type]"]').val();
  var title = $(this).find('[name="Form article[Title]"]').val()
+
  var title = $(this).find('[name="Form article[Title]"]').val();
  var authors = $(this).find('[name="Form article[Authors]"]').val()
+
  var authors = $(this).find('[name="Form article[Authors]"]').val();
 +
var month = $(this).find('[name="Form article[month]"]').val();
 +
var year = $(this).find('[name="Form article[year]"]').val();
 +
 
 +
var obj_months = {
 +
"1": "January",
 +
"2": "February",
 +
"3": "March",
 +
"4": "April",
 +
"5": "May",
 +
"6": "June",
 +
"7": "July",
 +
"8": "August",
 +
"9": "September",
 +
"10": "October",
 +
"11": "November",
 +
"12": "December"
 +
};
  
 
  var pagename;
 
  var pagename;
Line 296: Line 313:
  
 
   case 'post' :  
 
   case 'post' :  
   pagename = 'Posts/' + title;
+
   pagename = 'Posts/';
 +
  if(month && year) {
 +
    pagename += obj_months[month] + ' ' + year + ' - ' + title;
 +
  } else if(year) {
 +
    pagename += title + ' (' + year + ')';
 +
  } else {
 +
  pagename += title;
 +
  }
 
   break;
 
   break;
  
Line 313: Line 337:
 
*/
 
*/
  
  $(this).find('[name="Form article[Page name]"]').val(pagename)
+
  //$(this).find('[name="Form article[Page name]"]').val(pagename)
  
 
// return false;
 
// return false;

Revision as of 07:50, 12 March 2020

Different kind of articles might be published in different categories.
Please enter first and last name of authors separated by comma.
The day is optional, and specifically for kind of ‘post” and ‘article” might be omitted.
(Optionally), insert one significant thread representing the article. It might be used as a preview of it.
(Optionally), enter or more tags relevant to this article: they might be used to insert it under one or more corresponding categories.