Questions tagged [apostrophe-cms]

The official tag for ApostropheCMS. You can post code-related how-to questions about using Apostrophe, so that other community members can easily find answers to their problems. Please do not ask non-code related questions. Discussions, best practices, and ideas for development should be ...

0
votes
1answer
5 views

Is it possible to predefine widget values for a page template in apostrophe cms

I want to create a page template that will pre-populate fields for the widgets. For example Side Navigation I want it to place a two-column widget and define the parameters for that widget to place a ...
0
votes
0answers
4 views

Issue in updating apostrophe version 2.67.0

I am trying to update the apostrophe version from 2.62.0 to 2.67.0. I am getting below error: Promise { TypeError: Cannot read property 'css' of undefined at /app/node_modules/...
0
votes
0answers
14 views

Apostrophe Sitemap Database configuration

I have implemented the module apostrophe-site-map and the sitemap xmls are generating as per locale. Following is my module configuration 'apostrophe-site-map': { // array of doc types you do NOT ...
0
votes
0answers
6 views

TypeError: Cannot read property 'bitmap' of undefined (ApostropheCMS)

When trying to upload any GIF file , a weird error happen. This error came out : Unsupported MIME type: image/gif Unsupported MIME type: image/gif Unsupported MIME type: image/gif Unsupported MIME ...
0
votes
0answers
22 views

Remove Fields as option parameter in apostrophe-cms module

I am currently trying to get my modules to work properly. Extending the modules by adding Fields works great. I use several modules (e.g. "teaser") that extend a "container" which defines basic ...
0
votes
1answer
13 views

How to get the current locale in apostrophecms js file

I have js file in public folder of one of my module. I want the current selected locale in same file. Where file has defination apos.define('test-widgets', { improve: 'test-widgets', construct: ...
0
votes
0answers
13 views

Update HTML of a widget in Apostrophe CMS

We are using Apostrophe CMS for development. In our project we have installed a node module which implements cookie consent feature(developed by our developers themselves). We can call in our app.js ...
3
votes
1answer
26 views

Editor needs the permission to edit pages and add widgets to them

Im trying to create the role of an Editor, with permissions to edit piece-pages create pieces add widgets in piece-pages The problems i encountered were the following Editor could only edit the ...
1
vote
0answers
20 views

apostrophe cms version 2.65.0 giving error on running project

I am upgrading the apostrophe version from 2.62.0 to 2.65.0. While upgrading I have added the mongo driver-3 into setting also still running the project, I am getting the error : (node:116248) ...
0
votes
0answers
16 views

CSRF Issue and POST

I have the Following issue. I have added A module in app.js api: {} I want to POST Forms to this endpoint. The content of api/index.js is: module.exports = { construct: function (self, options) { ...
0
votes
0answers
13 views

Using Apostrophe with Nginx + PM2. Nodemon configuration

I'm having a hard time finding a solution to use nodemon with Apostrophe CMS hosted in a Nginx + PM2 environment. I already tried the watch feature of PM2 but nothing seems to work. Any ideas?
0
votes
0answers
32 views

Batch Operations Permanent Delete (Cyclic Dependency)

I want to add new batch operation where only happen in trash , the permanent delete should be running without cyclic dependency. But first , let's take a look on my addBatchOperations : // In lib/...
0
votes
0answers
8 views

Hide Some Pieces on Admin Bar (DRAFT MODE/LIVEMODE) - Apostrophe Workflow

This question is basically pretty straightforward already. I want some piece to be HIDE on Admin Bar in DRAFT MODE, but available in LIVE MODE by using this : 'apostrophe-workflow': { excludeTypes: ...
0
votes
0answers
44 views

Understanding cursors, filters and joins in apostrophe

Trying to work with some data in my widget's html and I've got to a point where I'm stuck, and just trying random things. If I'm honest the documentation around cursors is just not clear enough for ...
0
votes
1answer
22 views

Auto Join using (JoinByOne , JoinByArray)

Usually , user need to manually choose which pieces/pages that needed to join. For Example : Can it be programmatically join ? If some properties via cursor is available, then I want it to join with ...
1
vote
1answer
27 views

Apostrophe CMS db migrations

What is the right way to deploy db from dev to prod, and to pull it back after some changes made in prod? Now I just keep the mongo dump in the repository, but I think there should be a more correct ...
1
vote
1answer
19 views

Own beforeSave handler for the apostrophe widget

How to code the beforeSave() handler for the apostrophe widget? This code in the widget index.js does not work for me: module.exports = { extend: 'apostrophe-widgets', label: 'My widget', ...
1
vote
1answer
23 views

Multiple widget views

When selecting a type to display widgets from it would be nice to be able to have the option of selecting between several widget.html templates, similar to the way you can select a template when ...
0
votes
0answers
28 views

Custom JS not loading in apostrophe but CSS is

I'm having trouble getting my custom js to load when adding it to my themes module in apostrophe. Custom CSS is following the same setup and not encountering an error. I've followed documentation and ...
0
votes
1answer
88 views

Implementing apostrophe cms with socket.io

Im trying to implement Socket.io on Apostrophe cms 2.x I don't know how to get server object from express apos If I do the following I will have to create a new server on new port and I need ...
0
votes
1answer
26 views

How to modify content before writing to DB in Apostrophe

I am trying to add a field to each piece of content that gets created in Apostrophe that takes a value from the local.js file and adds it as an attribute to the record in mongo. For a variety of ...
0
votes
0answers
14 views

Apostrophe CMS API Create image from attachment

I have uploaded a png as per https://github.com/apostrophecms/apostrophe-headless#attachment-fields and I get back the following; {"_id":"cjlexm6ul000j7ewxnjnse382", "group":"images", "createdAt":"...
0
votes
1answer
24 views

ApostropheCMS workflow ignore incoming commits

Is there any way to ignore commits from certain pieces or widgets ? Currently , I build a comment pieces and a comment will always appear in live mode of apostrophe workflow. But then , it keeps ...
0
votes
0answers
18 views

Issue connecting to Mongo Atlas from Apostrophe CMS application on Elastic Beanstalk

I followed the instructions here to deploy my apostrophe cms website to aws elastic beanstalk. The mongodb doesn't have any whitelisting restrictions and is open to everyone. I set db coonection ...
0
votes
1answer
29 views

ApostropheCMS Moog Type - Extend your own Custom Module

Extend your own Module This question is basically a good question for a beginner who just new to OOP language. I found your code here said that extending module using afterConstruct is a good ...
0
votes
1answer
65 views

Connecting to Mongo Atlas from local Apostrophe cms code

I have enabled connection from anywhere 0.0.0.0/0 on Mongo Atlas. In apostrophe code, in the file data/local.js I added the following code : module.exports = { modules: { 'apostrophe-db': ...
0
votes
1answer
45 views

apostrophe-cms toolbar with floats

I've been putting together a site with apostrophecms, however I've come to the point with one of the layouts where it just doesn't play nicely. The content is a simple mixture of p and img tags (...
0
votes
1answer
43 views

Unmanaged Module Error in Console

This error came out on my console when I configured pieces in same database name using apos.singleton , but I managed to delete directly from DB itself using $unset method : * * * * * * * * * * * * *...
1
vote
1answer
48 views

In a project created using apostrophe create-project in Ubuntu 18.04, npm install fails

npm ERR! registry error parsing json npm ERR! registry error parsing json npm ERR! registry error parsing json npm ERR! fetch failed https://registry.npmjs.org/less/-/less-3.8.1.tgz npm WARN retry ...
0
votes
0answers
45 views

Apostrophe CMS + Express.js Backend + Angular integration

I've been trying to integrate Apostrophe CMS with a CRM platform that we have running on a node.js+express.js backend, but am finding it a bit difficult. I'll detail the setup before asking: We have ...
0
votes
0answers
21 views

Request to Apostrophe’s server

I’d like to make a request in my j=Javascript code to the Apostrophe’s server (like PUT, POST…). I did that but it does not work: {% extends "layout.html" %} {% block main %} <div class="main-...
0
votes
0answers
36 views

Sending nodejs module to the core browser

I'm tring to implement the nodejs module Readline to get input from Chrome console. So far I've created a module that creates a browser side module using self.apos.push.browserCall('always', 'apos....
0
votes
1answer
42 views

Render Page using ApostropheCMS Language

I know this kind of stupid question to ask . But for beginners and familiar with express nodejs , this question might found useful to others as well. For me , I am familiar rendering nunjucks with ...
1
vote
1answer
26 views

self.apos.modules['my-module'] is undefined

const myModule = self.apos.modules['my-module'] if I use this in construct of apostrophe-pages, where my-module is a subclass of apostrophe-module is there a chance that foo would be undefined?
0
votes
2answers
48 views

Submit Piece with Permissions “False” not updated to Draft Mode. Only Available in Live Mode

This project is using Apostrophe-Workflow . Therefore , I created my own custom module for comment system with permissions false (Follow this comment system but adjust the piece myself for non-logged ...
0
votes
1answer
48 views

Apostrophecms: Allow to upload PDF file only

I am having one field with relation. I want to upload only PDF files. Whereas I don't want to change the default setting for the dgad-attachments from app.js/default.js that allows all office type of ...
0
votes
0answers
28 views

How to customise the admin bar in ApostropheCMS?

I am new to ApostropheCMS. I went through the documentation and tried out demos of it. I have created a user listing with filters on it as per the tutorial but I have not got the gist of it completely....
0
votes
1answer
31 views

Custom Comments Form Module

Okay , I don't know where I am wrong in the code. But it does not show up comment piece when submitting comments in show.html . In my show.html , I have my singleton: <section class="comment-...
0
votes
1answer
37 views

Apostrophe mongo db user not authorized to execute command

When i deploy my cms it is unable to perform a particular query on the underlying mongo-db. I keep getting the following error: MongoError: not authorized on cms-db to execute command { find: "...
0
votes
0answers
13 views

Create a back office for user profile with apostrophe cos

I want to create a backoffice where the user can edit his profile, but I don’t know where to start. I was thinking that I could start inspiring from the “contact form” tutorial, and adapt it to get ...
0
votes
1answer
53 views

Nodemon in ApostropheCMS not working

This is my output after launching nodemon. I also have the latest nodemon config after create-project using apostrophe-cli . I tried many solutions online but none of them fixed it. Somehow errors on ...
-1
votes
2answers
48 views

How to set a favicon in ApostropheCMS

I have tried to set a favicon image from apostrophe-assets in my ApostropheCMS site but I haven't been able to do that. I have found this solution: <link rel="shortcut icon" type="image/png" ...
0
votes
1answer
46 views

css errors in apostrophe-ui, best approach to solve it?

I was running my blog through a CSS Validator and found out some fonts that come out of the box are not being defined correctly, to be specific, this is in apostrophe/lib/modules/apostrophe-ui/public/...
0
votes
0answers
37 views

Docker - Error: EEXIST: file already exists, symlink

I have developed a small "proof of concept" ApostropheCMS application. The application runs fine with node app.js. I'm trying to build and deploy with Docker for Windows on Windows 7 with Oracle VM ...
1
vote
1answer
32 views

Access template options in module's construct method

In Apostrophe, I have a custom module where I would like to pass an option from the Nunjucks apos.area call to the construct method of the widget itself. Concretely, I want to adjust the output of ...
0
votes
1answer
23 views

Advanced Workflow Review Process

I am trying to set up a workflow process that has multiple states for a page: Authoring (draft), Reviewing, Approving, Live. The roles would be as follows: authors (all users), editors (assigned per ...
0
votes
1answer
84 views

Custom Search on Current Page

Simple question , I want to query results on PIECES PAGES . Like what I did using Express + NodeJS + MongoDB + Mongoose is simply like this : // GET /api/question/:id router.get('/question/:id' , (...
0
votes
1answer
28 views

is there any way to change apostrophe cms login url?

Currently apostrophe cms login url is /login How to change it to some other url ?? example: /sample_login
0
votes
0answers
32 views

Load widget dynamically

I´ve got two pieces 'books' and 'shelfs'. I have assigned one book in the shelf-piece as a field. In the show.html of the shelf piece i wanted to load an book-widget dynamically without any user ...
0
votes
0answers
24 views

Template loads wrong css path in Apostrophe cms

template render css file in http://localhost:3000/css/..modulesmy-apostrophe-assets%0Cssstyles.css instead of http://localhost:3000/modules/my-apostrophe-assets/css/bootstrap.min.css but my css ...