aw schriftzug.png aw logo 60x60.png

SeoTopicEditTemplate
Editor for SeoTopics

2019-05-02 - 10:19 | Version 3 |

%TMPL:INCLUDE{"Applications.ClassificationApp.ClassifiedTopicEdit"}%

%TMPL:DEF{"validationrules"}% {'MetaDescription': {maxlength:160}} %TMPL:END%

%TMPL:DEF{"formfields"}%<!-- --> 
%TMPL:P{"categoriestab"}% 
%TMPL:P{"tagstab"}% 
%TMPL:P{"seotab"}% 
<!-- -->%TMPL:END%

%TMPL:DEF{"seotab"}%<!-- -->
%TAB{"%TRANSLATE{"SEO"}%"}%
---++ %TRANSLATE{"Search engine optimization"}%
%RENDERFOREDIT{"%BASEWEB%.%BASETOPIC%"
  form="%TMPL:P{"formdefinition"}%"
  fields="HTMLTitle, MetaKeywords, MetaDescription, MetaImage"
  HTMLTitle_title="%TRANSLATE{"HTML Title"}%"
  MetaKeywords_title="%TRANSLATE{"Meta keywords"}%"
  MetaDescription_title="%TRANSLATE{"Meta desciption"}%"
  MetaKeywords_default="%TAGINFO{topic="%BASEWEB%.%BASETOPIC%" format="$name"}%"
  MetaDescription_default="%FORMFIELD{"Summary" topic="%BASEWEB%.%BASETOPIC%"}%"
  MetaImage_title="%TRANSLATE{"Meta Image"}%"
}%
%ADDTOZONE{"script" 
   text="<script type='text/javascript' src='%PUBURLPATH%/Applications/ClassificationApp/SeoTopicEditTemplate/seo-topic-edit.js'></script>" 
   id="SEOTOPICEDIT::JS"
   requires="JQUERYPLUGIN"
}%%ENDTAB%
<!-- -->%TMPL:END%

"use strict";
jQuery(function($) {
  $(document).on("click", "#clsGenerateTitle", function() {
    $(this).parents(".foswikiFormStep:first").find("input").val($("input[name=TopicTitle]").val());
    return false;
  });

  $(document).on("click", "#clsGenerateDescription", function() {
    var $field = $(this).parents(".foswikiFormStep:first").find("textarea"),
        description = $("input[name=Summary]").val();

    if (!description) {
      description = $("#topic").val();
    }

    $field.val(description.replace(/<[^>]*>/g, "").replace(/\n\s*\n/g, "").substr(0, 160));
    return false;
  });

  $(document).on("click", "#clsGenerateKeywords", function() {
    var $field = $(this).parents(".foswikiFormStep:first").find("input"),
        keywords = [];

    $("input[name=Tag], input[name=Category]").each(function() {
      var vals = $.trim($(this).val()).split(/\s*,\s*/);
      $.each(vals, function(index, val) {
        val = val.replace(/Category$/, "");
        if (val) {
          keywords.push(val);
        }
      });
    });

    $field.val(keywords.join(", "));
    return false;
  });
});
Topic attachments
I Attachment Action Size Date Who Comment
seo-topic-edit.jsjs seo-topic-edit.js manage 1 K 2019-05-02 - 09:59 ProjectContributor Generated by AttachContentPlugin
Warning: Can't find topic Applications/ClassificationApp.WebLeftBarExample

Impressum © Alexander Weimer GmbH