added new article field "titleAlias", can be used as alternate article title, useful...
authorAdrian Oldham <adriann@visualthought.com.au>
Wed, 8 Aug 2007 06:58:53 +0000 (06:58 +0000)
committeradriann <adriann@45cb6cf1-00bc-42d2-bb5a-07f51df49f94>
Wed, 8 Aug 2007 06:58:53 +0000 (06:58 +0000)
schema/bse.sql
site/cgi-bin/modules/Article.pm
site/cgi-bin/modules/BSE/DB/Mysql.pm
site/docs/config.pod
site/templates/admin/edit_catalog.tmpl
site/templates/admin/edit_product.tmpl
site/templates/admin/edit_seminar.tmpl
site/util/initial.pl

index d63eba94ce95457675866ba3537ef94807e7c0fd..b643f968645567b3474cdb43c0a62748157c5467 100644 (file)
@@ -94,6 +94,8 @@ CREATE TABLE article (
   -- filter menu value in allkids_of iterators
   menu smallint(5) not null default 0,
   
+  titleAlias varchar(60) not null default '',
+  
   PRIMARY KEY (id),
 
   -- if we keep id in the indexes MySQL will sometimes be able to
index 64e664eca25fedae2b8773a623b089b65fdf3d84..63a87d3f4803dd34746305a34d34692149862cae 100644 (file)
@@ -15,7 +15,7 @@ sub columns {
     customInt1 customInt2 customInt3 customInt4 
     lastModifiedBy created createdBy author pageTitle
     force_dynamic cached_dynamic inherit_siteuser_rights
-    metaDescription metaKeywords summary menu/;
+    metaDescription metaKeywords summary menu titleAlias/;
 }
 
 sub numeric {
index 97d68bab211b65775b1272e6e771f64d6d1a620e..5a23a8e31763614ea2fd018038ee4313bd621d0a 100644 (file)
@@ -18,9 +18,9 @@ my %statements =
   (
    Articles => 'select * from article',
    replaceArticle =>
-     'replace article values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+     'replace article values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    addArticle =>  
-     'insert article values (null, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
+     'insert article values (null, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)',
    deleteArticle => 'delete from article where id = ?',
    getArticleByPkey => 'select * from article where id = ?',
    
index e1360e8c72caa38082a692e5c5bc1f3348d71059..1ad35766480fe69b9de2d9388f23f6626b78e37b 100644 (file)
@@ -1529,6 +1529,28 @@ For example:
 
 =back
 
+=head2 [title alias]
+
+Enable the "titleAlias" article field and set which level it will be available.
+
+=over
+
+=item levelI<level>
+
+Where I<level> is the article "level" for which the "titleAlias" field should be enabled.  To enable
+set the value to non-zero.
+
+For example:
+
+  [title alias]
+  level1=1
+
+The "titleAlias" can be used as an alternate "short" title for the given article, especially useful
+for space critical iterated menus.  A template conditional can be used to display the "titleAlias" 
+in place of the article "title" when appropriate.
+
+=back
+
 =head1 AUTHOR
 
 Tony Cook <tony@develop-help.com>
index 5c1af315753ee0e1fd0229c2fb74c9f6d7105863..dd4182cd4b327bb67a04ccddfd4b5d0d5f7d1f9f 100644 (file)
             </td>
             <td nowrap="nowrap" bgcolor="#FFFFFF"><:help catalog title:> <:error_img title:></td>
           </tr>
+          <:if Cfg "title alias" [concatenate level [article level]]:><tr>
+            <th nowrap="nowrap" bgcolor="#FFFFFF" align="left">Alias:</th>
+            <td bgcolor="#FFFFFF" width="100%">
+              <:if FieldPerm titleAlias:><input type="text" name="titleAlias" maxlength="<:cfg fields alias_size 60:>" size="60" value="<:old titleAlias article titleAlias:>" /><:or FieldPerm:><:article titleAlias:><:eif FieldPerm:>
+            </td>
+            <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit titleAlias:> <:error_img titleAlias:></td>
+          </tr><:or Cfg:><:eif Cfg:>
           <tr> 
             <th valign="top" bgcolor="#FFFFFF" nowrap="nowrap" align="left"> Body:</th>
             <td bgcolor="#FFFFFF" width="100%"> 
index 649eb6c14ebae4efae5c6ed7127f52322fa14521..8fc2f588b856f4bf23cce55d55de82aa1791a736 100644 (file)
             <td bgcolor="#FFFFFF"><:ifFieldPerm title:><input type="text" name="title" value="<:old title default title:>" size="60"><:or:><:product title:><:eif:> </td>
             <td nowrap="nowrap" bgcolor="#FFFFFF"><:help product title:> <:error_img title:></td>
           </tr>
+          <:if Cfg "title alias" [concatenate level [article level]]:><tr>
+            <th nowrap="nowrap" bgcolor="#FFFFFF" align="left">Alias:</th>
+            <td bgcolor="#FFFFFF" width="100%">
+              <:if FieldPerm titleAlias:><input type="text" name="titleAlias" maxlength="<:cfg fields alias_size 60:>" size="60" value="<:old titleAlias article titleAlias:>" /><:or FieldPerm:><:article titleAlias:><:eif FieldPerm:>
+            </td>
+            <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit titleAlias:> <:error_img titleAlias:></td>
+          </tr><:or Cfg:><:eif Cfg:>
           <tr> 
             <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Summary:</th>
             <td nowrap="nowrap" bgcolor="#FFFFFF"><:ifFieldPerm summary:><input type="text" name="summary" value="<:old summary default summary:>" size=60><:or:><:product summary:><:eif:> </td>
index 5dbca9d163914d88e6b16de1747cf42b61dbf873..a1135abbce3cf3c89f49e4d4e6eca2504af0a6d8 100644 (file)
             <td bgcolor="#FFFFFF"><:ifFieldPerm title:><input type="text" name="title" value="<:old title default title:>" size="60" /><:or:><:seminar title:><:eif:> </td>
             <td nowrap="nowrap" bgcolor="#FFFFFF"><:help product title:> <:error_img title:></td>
           </tr>
+          <:if Cfg "title alias" [concatenate level [article level]]:><tr>
+            <th nowrap="nowrap" bgcolor="#FFFFFF" align="left">Alias:</th>
+            <td bgcolor="#FFFFFF" width="100%">
+              <:if FieldPerm titleAlias:><input type="text" name="titleAlias" maxlength="<:cfg fields alias_size 60:>" size="60" value="<:old titleAlias article titleAlias:>" /><:or FieldPerm:><:article titleAlias:><:eif FieldPerm:>
+            </td>
+            <td nowrap="nowrap" bgcolor="#FFFFFF"><:help edit titleAlias:> <:error_img titleAlias:></td>
+          </tr><:or Cfg:><:eif Cfg:>
           <tr> 
             <th nowrap="nowrap" align="left" bgcolor="#FFFFFF">Summary:</th>
             <td nowrap="nowrap" bgcolor="#FFFFFF"><:ifFieldPerm summary:><input type="text" name="summary" value="<:old summary default summary:>" size="60" /><:or:><:seminar summary:><:eif:> </td>
index 5842fd68b0035b43f95d8f4d95e64914b22cda83..7069df44cec124e4888ddefac43c9e92d88cacaf 100644 (file)
@@ -56,6 +56,7 @@ my @prebuilt =
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
    {
     # the invisible subsection for what's hot
@@ -94,6 +95,7 @@ my @prebuilt =
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
    {
     id=>3,
@@ -131,6 +133,7 @@ my @prebuilt =
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
    {
     id=>4,
@@ -168,6 +171,7 @@ my @prebuilt =
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
    {
     id=>5,
@@ -205,6 +209,7 @@ my @prebuilt =
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
    {
     id=>6,
@@ -472,6 +477,7 @@ EOS
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
    {
     id=>7,
@@ -513,6 +519,7 @@ EOS
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
    {
     id=>8,
@@ -554,6 +561,7 @@ EOS
     metaKeywords=>'',
     summary => '',
     menu => 0,
+    titleAlias => '',
    },
   );