一个Django应用程序,它提供和基础设施,你可以用它来包含其他应用程序的自定义内容。
django-resckeditor的Python项目详细描述
#django resckeditor
这是一个django应用程序,它提供和基础结构,您可以使用它直接在ckeditor中包含其他应用程序的自定义内容。
它需要[django ckeditor](https://github.com/django ckeditor/django ckeditor)
它定义了一个自定义ckeditor插件,该插件实现两个对话框选项卡:第一个到选择资源,然后选择第二个动态设置选项。
**完整文档**:[https://django resckeditor.readthedocs.io/en/latest/](https://django resckeditor.readthedocs.io/en/latest/)
![截图](docs/images/list.png)
![屏幕截图](docs/images/options.png)
…
)
您的ckeditor实例的ajax插件:
ckeditor_configs={
'默认值':{
'外观':'moono',
'工具栏已满':[
/..
['res'/*,…*/],
/..
'工具栏':'full',
/…
“ExtraPlugins”:“ajax,resource”,
}
}
>定义函数导出ckeditor的资源,例如在您的设置中:
resckeditor_config={
“resources”:[
{
“list”:“path.to.module.func.defining.resources”,
“输出”:“path.to.module.func.returning.html”,
“标签”:“我的小部件组”
},
]
}
res.append({
‘label’:n.title,
‘id’:n.id
})
返回{
‘resources’:res,
‘options’:[
{
‘type’:‘text’,
‘name’:‘news dialog options section title’,
‘label’:“上一条新闻”,
“默认”:“
},
{
“类型”:“复选框”,
“名称”:“新闻对话框选项显示标题”,
“标签”:“显示标题”,
“默认”:true
},
{
'type':'number',
'name':'news dialog options num chars',
'label':'number of chars',
'default':50
},
{
'type':'select',
'name':'news dialog options layout',
'label':'layout',
'data':[
{'label':'one row','value':'row'},
{'label':'two columns','value':'col-2'},
{'label':'three columns','value':'col 3'},
{'label':'four columns','value':'col 4'},
]
}
]
}
包含提供的选项的字典。
它应该返回资源的HTML输出。
def my_output_function(id,options):
n=news.objects.get(pk=id)
return'<;h1>;%s<;/h1>;'%n.title
number和select,但对于几乎所有的用例来说都应该足够了。
语法和必需的属性是您可以在上面的示例中使用的属性(文本与number具有相同的属性)。
这是一个django应用程序,它提供和基础结构,您可以使用它直接在ckeditor中包含其他应用程序的自定义内容。
它需要[django ckeditor](https://github.com/django ckeditor/django ckeditor)
它定义了一个自定义ckeditor插件,该插件实现两个对话框选项卡:第一个到选择资源,然后选择第二个动态设置选项。
**完整文档**:[https://django resckeditor.readthedocs.io/en/latest/](https://django resckeditor.readthedocs.io/en/latest/)
![截图](docs/images/list.png)
![屏幕截图](docs/images/options.png)
…
)
您的ckeditor实例的ajax插件:
ckeditor_configs={
'默认值':{
'外观':'moono',
'工具栏已满':[
/..
['res'/*,…*/],
/..
'工具栏':'full',
/…
“ExtraPlugins”:“ajax,resource”,
}
}
>定义函数导出ckeditor的资源,例如在您的设置中:
resckeditor_config={
“resources”:[
{
“list”:“path.to.module.func.defining.resources”,
“输出”:“path.to.module.func.returning.html”,
“标签”:“我的小部件组”
},
]
}
res.append({
‘label’:n.title,
‘id’:n.id
})
返回{
‘resources’:res,
‘options’:[
{
‘type’:‘text’,
‘name’:‘news dialog options section title’,
‘label’:“上一条新闻”,
“默认”:“
},
{
“类型”:“复选框”,
“名称”:“新闻对话框选项显示标题”,
“标签”:“显示标题”,
“默认”:true
},
{
'type':'number',
'name':'news dialog options num chars',
'label':'number of chars',
'default':50
},
{
'type':'select',
'name':'news dialog options layout',
'label':'layout',
'data':[
{'label':'one row','value':'row'},
{'label':'two columns','value':'col-2'},
{'label':'three columns','value':'col 3'},
{'label':'four columns','value':'col 4'},
]
}
]
}
包含提供的选项的字典。
它应该返回资源的HTML输出。
def my_output_function(id,options):
n=news.objects.get(pk=id)
return'<;h1>;%s<;/h1>;'%n.title
number和select,但对于几乎所有的用例来说都应该足够了。
语法和必需的属性是您可以在上面的示例中使用的属性(文本与number具有相同的属性)。