apostrophe-cms

Editor permission for pieces

左心房为你撑大大i 提交于 2019-12-11 18:36:12
问题 I'm trying to grant editor permissions on specific pieces for any editor. Try applying as described in apostrophe-permissions and permissionsFields. However, I still can't get my editors to be able to edit any piece they want, even if they haven't created it. This is what I have in my app.js : 'apostrophe-users': { groups: [ { title: 'editor', permissions: [ 'edit-placementGuide', 'edit-market','edit-email-template' ] }, { title: 'admin', permissions: [ 'admin' ] } ] }, Pieces appeared on the

ApostropheCMS: How to emit Events from Browser to Server

送分小仙女□ 提交于 2019-12-11 17:09:30
问题 I am new to Apostrophe and i cant find a solution for a communication between Client and Server. I want to get some Data from my MySQL Database into my ApostropheCMS (i have a big Database with over 50k Rows). But i cant find a way, how to communicate between the Browser and the Server. If i emit an Event from Client, it only triggers apos.on in the Browser, but not on the Server-side. I cant find any answers in the Documentation, so i really need help. Thanks for all answers 回答1: The apos

How to separate Apostrophe syles from the front end template

痴心易碎 提交于 2019-12-11 17:01:46
问题 I keep running into the conflicts between the front end CSS styles and Apostrophe's own. For example, after i added the template Apostrophe form input fields are now shown in all capitals and alignment is all off. Is there a recommended way to separate them into different scopes? Thanks in advance. 回答1: This is a very common issue to CMSes, not only to Apostrophe. Personally, I've developed a habit of limiting the scope of all my CSS and JS files to that of the modules they refer to and since

Apostrophe CMS running with Dynamo DB

帅比萌擦擦* 提交于 2019-12-11 15:57:57
问题 We would like to run Apostrophe in AWS, however our policy is to use Dynamo DB for our database needs. Is this possible? On https://docs.apostrophecms.org/apostrophe/tutorials/intermediate/accessing-the-database-directly#making-your-own-database-connections It says: Maybe you don't even want to use MongoDB at all. That's okay. Nobody's stopping you from making your own database connection for your project-specific code. I assume that means it is possible. I have tried extending the apostrophe

How to access options inside apos.define?

孤者浪人 提交于 2019-12-11 07:04:05
问题 apostrophe-workflow has the following: public/js/user.js apos.define('apostrophe-workflow', { [...] construct: function(self, options) { self.locales = options.locales; self.locale = options.locale; [...] I searched quite a while and did not manage to find the reason why this construct method has access to the options object. I tried browserCall but am not sure how to use this properly. My assets are pushed using pushAsset , too. But they do not have access to the options after apos.create .

Dynamic Select fields in apostrophe inside Array field type

為{幸葍}努か 提交于 2019-12-11 06:47:45
问题 Functions for select field choices cannot be read when inside an Array field I can call a function to populate a select field's choices but when the same select field is inside an Array field I get TypeError: Cannot read property 'functionname' of undefined/ module.exports = { name: 'testtype', addFields: [ { name: 'test_dynamic_select', type: 'select', choices: 'testchoice' }, { name: 'insidearray', label: 'In Array', type: 'array', schema: [ { name: 'test_dynamic_select_in_array', type:

Incorporating gulp to compile js in apostrophe?

独自空忆成欢 提交于 2019-12-11 05:41:54
问题 Has anyone rolled gulp into apostrophe for compiling assets? I'd like to use ES6, as I'm using a frontend framework that has all of the js nicely split up into separate assets, and have the compilation of that into one minified file part of the normal apostrophe build process (I'm using apostrophe-assets to reference a single root js file which imports everything else). 回答1: Great question. You're going to want to build your JavaScript with Gulp into one file before pushing that file to the

Add static assets to Apostrophe project, specifically images and font files

有些话、适合烂在心里 提交于 2019-12-11 05:27:30
问题 How do I add static assets to my Apostrophe project? The documentation only mentions pushing assets that are JavaScript or LESS files. It makes no mention of other static assets. In particular, I'd like to import a font face into my CSS, but there doesn't seem to be a way to include my OTF and TTF files. 回答1: You can add static assets such as fonts or images to the /public directory which is automatically made available by the server. You can reference them from the root file path, such as

How to define widgets with default values in Apostrophe CMS

别说谁变了你拦得住时间么 提交于 2019-12-11 04:47:05
问题 I want to add a widget that can't be removed from the page and contain some default text when it is not defined explicitly. I thought it should work something like this: {{ apos.singleton(data.page, 'headerTitle', 'apostrophe-rich-text', { def: 'Default Title' }) }} Is there any way to do this with apostrophe widgets or I should create custom one? 回答1: Creating your own widgets is pretty standard practice in Apostrophe but it doesn't address what to do if there is no widget yet in a singleton

how to serve static content outside the db?

隐身守侯 提交于 2019-12-11 04:04:39
问题 I'm trying to figure out how to push static files, like an svg or an image, in a module without having to put it in the db. I've created a simple module that define a route with self.apos.app.get and with pushAssets I send js and css to render a template, but how to serve an image or svg defined in the css? I can put them in prj_root/public but I'm unsure if this is the way to do it. I've tried to put in my_module/public but they are not found 回答1: If you put a file called my.png in /public