联系官方销售客服

1835022288

028-61286886

应用插件 版主:官方插件技术组
前台表单投稿如何成为文章模块内的文章
类型:迅睿CMS 更新时间:2021-04-19 12:49:35

前台表单投稿如何成为文章模块内的文章

比如 文章 / news 内容页放置一个投稿表单newsform

1)自动选择当前页面所属栏目为投稿栏目

2)自动关联当前页面文章,调用时可以按关联条件调用

3)表单投稿后会成为news模块的一篇普通文章,表单投稿填写字段会有title,description ,content,


重点:表单投稿后会成为news模块内一篇普通文章,不存储到form数据表内


插件版权:官方插件
插件名称:模块表单

回帖
  • 猪肉贩子
    #1楼    猪肉贩子
    2021-04-18 11:17:59
    Chrome 0
    增加悬赏(设置悬赏)金:10元,希望大家给予帮助!
  • 官方插件技术-大山
    #2楼    官方插件技术-大山
    2021-04-18 11:18:28
    Chrome 0
    模块表单就是内容的子内容,他本身就关联好了内容,他是先有内容再有子表单
  • 猪肉贩子
    #3楼    猪肉贩子
    2021-04-18 11:20:11
    Chrome 0
    官方插件技术-大山 关联是没错,然而它提交后存储到form数据表内,没有成为文章news模块内的一篇普通文章
  • 官方插件技术-大山
    #4楼    官方插件技术-大山
    2021-04-18 11:25:26
    Chrome 0
    目前没有这种功能
  • 小黄人 18html
    #5楼    小黄人 18html
    2021-04-18 17:21:39
    iPhone手机 0
    可以有
  • 小黄人 18html
    #6楼    小黄人 18html
    2021-04-19 09:57:14
    Chrome 0
    <form action="" class="form-horizontal" method="post" name="newsform" id="newsform">
    <input name="is_form" type="hidden" value="1">
    <input name="is_admin" type="hidden" value="0">
    <input name="is_tips" type="hidden" value="">
    <input name="csrf_test_name" type="hidden" value="{csrf_hash()}">
    <input name="is_draft" id="dr_is_draft" type="hidden" value="0">
    <input name="module" id="dr_module" type="hidden" value="news">
    <input id='dr_catid' name='catid' type="hidden" value="{$catid}">
    <input name="id" id="dr_id" type="hidden" value="0">
    
    
    <input name="data[title]" id="dr_title" value=""/>
    <script type="text/javascript" src="/api/ueditor/ueditor.config.js?v=20210409165251"></script>
    <script type="text/javascript" src="/api/ueditor/ueditor.all.min.js?v=20210409165251"></script>
    <script class="dr_ueditor" name="data[content]" type="text/plain" id="dr_content"></script><script type="text/javascript">$(function(){var editor_content=new baidu.editor.ui.Editor({ismobile:0,UEDITOR_HOME_URL:"/api/ueditor/",UEDITOR_ROOT_URL:"/api/ueditor/",serverUrl:"/index.php?s=api&c=file&token=a987a876a6f403a4404fb9243621aa8e&m=ueditor&image_reduce=0&attachment=0&is_wm=0&rid=news/home/add/id:0&",lang:"zh-cn",langPath:"/api/language/",toolbars:[["undo","redo","|","bold","italic","underline","fontborder","strikethrough","superscript","subscript","removeformat","formatmatch","autotypeset","blockquote","pasteplain","|","forecolor","backcolor","insertorderedlist","insertunorderedlist","selectall","cleardoc","|","rowspacingtop","rowspacingbottom","lineheight","|","customstyle","paragraph","fontfamily","fontsize","|","directionalityltr","directionalityrtl","indent","|","justifyleft","justifycenter","justifyright","justifyjustify","|","touppercase","tolowercase","|","link","unlink","anchor","|","imagenone","imageleft","imageright","imagecenter","|","simpleupload","insertimage","emotion","scrawl","insertvideo","attachment","map","insertframe","insertcode","template","background","|","horizontal","date","time","spechars","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","charts","|","print","preview","searchreplace","drafts"]],initialContent:"",pageBreakTag:"_ueditor_page_break_tag_",initialFrameWidth:"100%",initialFrameHeight:"400",initialStyle:"body{font-size:14px}",autoFloatEnabled:false,allowDivTransToP:true,autoHeightEnabled:false,charset:"utf-8",});editor_content.render("dr_content")});</script>
    
    <input name="data[description]" id="dr_description" value=""/>
    
    <input name="data[keywords]" id="dr_keywords" value="{$meta_keywords}"/>
    <input type="text" class="form-control" name="code">{dr_code(120, 35)}
    
    <button type="button" onclick="$('#dr_is_draft').val(0);dr_ajax_submit('/index.php?s=member&app=news&c=home&m=add', 'newsform', '2000')" class="btn green"> <i class="fa fa-save"></i> 保存内容</button>
    </form>
    满意答案
  • 小黄人 18html
    #7楼    小黄人 18html
    2021-04-19 09:58:04
    Chrome 0
    使用关键字做关联~ 如果你要用关联字段的话,就需要专门针对关联字段做一个写法
  • 猪肉贩子
    #8楼    猪肉贩子
    2021-04-19 12:26:04
    Chrome 0
    小黄人 18html 真厉害啊,数据提交功能已经实现了。字段关联暂等下个阶段再说。目前还有几个疑问:1)如何调用表单?show.html页面放置按钮<a href="{Router::mform_post_url("newsform", $id, news)}">点击按钮跳转去表单</a>对应的url为: /index.php?s=news&c=newsform&m=post&cid=数字这样是否正确?2)<input name="data[description]" id="dr_description" value=""/> 我修改为<textarea提交内容存储不完整,只存储了一个文字。<div class="form-group" id="dr_row_description"> <label class="control-label col-md-2">描述</label> <div class="col-md-10"><textarea class="form-control" style="height:60px; width:500px;" name="data[description]" id="dr_description"></textarea></div></div>3)show.html提交表单,提交成功后如何返回到之前浏览的show.html
  • 猪肉贩子
    #9楼    猪肉贩子
    2021-04-19 12:49:35
    Chrome 0
    @小黄人 18html:已经可以表单投稿了,感谢回复。