N2cms add settings page - n2

I want to add some settings which the admin of the site can change.
First idea came to my mind is to create an N2 page called settings, and every property of this page is single setting, and each time I need to get the settings I have to search for the first N2 page of the type Settings.
The problem with this approach is that I can't control how many Settings page the admin can add, and may be he added more than one.
So another idea came to my mind. Create an independent controller and a class called settings and have a corresponding database table.
Does anyone have better ideas?

Add properties on the start page. You'll always have only one start page.

I think your second idea might be best - a custom controller and table. That is if the 'settings' are not related to N2 itself. If they are, then I guess that N2 probably offers a way to do that.
But if the settings you'd like to offer to your user isn't related to how N2 works, then I wouldn't worry about it, and just create an independent controller, class and corresponding database table.

I would go with Settings tab on Root page. Benefits - you can get it in no time via N2.Find.Root, and it will apply to all start pages you might have. Please note that in latest recommended setup of N2, there is one StartPage per language, so your site settings should be definitely above these, applying to all language branches.
IMHO, separate table would be overkill for reasonable amount of settings.

Related

TYPO3 User Management

I think only one thing is missing...
but I do not get this point :p
i created an user and I created a group, both didn't work
What I want is a group with specific rights, one with read and edit rights and one with only read rights, but all only works for the "root page"
how can I inherit this to the following pages?
All the things from older versions of TYPO3 do not really work at my version (my version is 7.6.14)
Update 1:
Okey, I could set the rights by hand for every single page in the access category. But I think there should be a possibility to inherit the rights to all the subpages?
At last it may only be one checkbox ore option I have to activate?
One picture to make it more clearly what my problem is:
For those who don't understand german, "Berechtigungen" means access and "Tiefe" means depth.
Solution
I finally got it and it and it is working fine.
I just need to set the depth at the right place here:
One more hint: be_acl is a good extention, if you need more than one group for a page or more specific rights for different users.
Maybe the group does not have access to the subpages?
In the backend under System -> Access you can change the ownership of pages -
owner, group and all.
When editing access control of one page, you can change the depth to automatically adjust subpages.
You can find a really good article about right management in the blog from Marcus Schwemer here: https://typo3worx.eu/2017/02/typo3-backend-user-management/
For other things it would be useful if you could provide a little bit more informations about what does not work?
For example it could be that your user has no access to the page tree, if this is the case there is an extra "Access" Backend module. You can find more information about this here.

laravel 5; redirect to previous section after store or view

I think this is a basic problem or question, but i can't find any solution that solves this problem, so probably i'm searching in the wrong way or on the wrong keywords.
I have a bunch of articles in my DB, and there are a number of ways to read/edit them on the site.
- The visitor can see them in a list, click on them and read the whole article
- The registered users can see them in the same list, but click on them to read or edit the article
- The admin can see a different list (an different view), and edit or delete them
and i'm sure i will come up with some other ways to read or edit the articles or other data.
The point is, that if a visitor or user had read or edited the article, i want them to return to their own index of articles, but if an admin has read or edited the article i want him to go back to the admin-index.
So from the start i have a number of routes:
Route::get('/article'... will display the index of articles
Route::get('/article/{name}'... will display an article
Route::get('/article/{name}/edit'... will display the edit form for the article
Route::post('/article/{name}'... will update the article
And for the admin:
Route::get('/admin/article'... will display the index of article
Route::get('/admin/article/{name}'... will display an article
Route::get('/admin/article/{name}/edit'... will display the edit form for the article
Route::post('/admin/article/{name}'... will update the article
But..Route::post('/article/{name}' and Route::post('/admin/article/{name} should point to the same function to update the data, and that function should redirect to different routes, in this case Route::get('/article' and Route::get('/admin/article'
I really dont want to write 2 different routines to store or update the data in the database, that are in fact the same, except for the 'redirect'-line after updating or storing.
My first thought was to make 2 routes, with two entries in my controller that each call the same routine that saves the data, and return where i can redirect, but then i would have to use different 'actions' in my form. That would mean i would have to make 2 forms that are the same, except for the 'action'-line.
Whatever i do, i would have to redirect somewhere based on the section of my site where i was before i started to read or edit my data.
I read something about the 'back()'-function, but that won't help me because i want to be able to read an article, and then choose to edit it, then return back to my index.
I hope i was able to explain what i want to do, and i'm sure i'm not the only one looking for this, but again, i failed in finding a right solution.
What is het best way to achieve this?!?
I would just separate the controllers between normal users and admin users. This way your code will stay clean and understandable.
You could for example make the following folder structure:
app
- Http
- Controllers
- Admin
- User
Don't forget to change the namespace in your controllers.
If you really want to stick with the same controller for both users then you need to make some kind of if else statement to see what kind of user your are dealing with and redirect on that outcome. Do you have some kind of role structure in your application?

Content merging AEM

We're looking for a solution on how to best deal with the situation where multiple authors are working on the same page. If the first author pushes in the content, the second should have a way to merge it when he tries to publish. Launches appears to be a way to take care of this but it doesn't seem to be handling content merging. Is there any way an author can view the diff(and or do merge) of the content that might have been pushed by another author while they were working concurrently ?
Please help with any pointers.
Page modifications happen in real time to the underlying structure. They also happen at as small a level as possible.i.e. If you go into a text area and modify the text there, the text node is changed on the server, you aren't saving the entire page.
The only way that person A could interfere with what person B is doing is if they were working on the exact same area of the page. Which, honestly is a process issue. I say this because the answer to your question is that there is nothing out of the box to handle this type of scenario and if you are on 6.0 or higher and looking at the JCR3. JCR3 handles this far worse than the older version did. Last time I checked it didn't support nodes at all
Adding to what Bailey said, AEM OOB allow multiple users to edit same page in real time, though if multiple users are working on same node will be a reason of conflict. Such cases can be managed by defining a process like:
1. Take a lock of page and edit page or
2. Create versions of page and publish versions

Calling pop up from different pages .jsf

Does anyone know how I can get the same pop up via a button located on different pages (.JSF)?
That is, there is a button "add file" which then opens a pop up with a form where the user adds information about the file. As the pop up is always the same I was thinking of using declarative components. However, I do not understand how.
You can create a taskflow which will contain your page with upload form, and then reuse it on other pages as af:region. Check out this great post with an example how to do it.
I might think about three different ways to achieve this:
1) As #Pregrad said, you can create a Bounded Task Flow and expose this BTF as region (or dynamic region) in every page you need it as a popUp window (recommended if you are using transactions)
2) You can create page templates, put the af:popUp in them and apply the template for each page (recommended if you already have templates, and you need the popUp for each page on your application)
3) You can put the af:popUp component on each page you need it, and then call it programmatically. This approach may be would give you more control on the popUp behaviour but would require you to handle it manually.
The approach you should use does really depend on your needs.

Internal state in backbonejs application

I am creating an application and trying to figure out best way to deal with navigation in it. User can choose different view settings (which content to show and options to filter it). Part of settings is stored in backend in user preferences model. Another part is stored in url and managed by router. But there is more settings I want to keep. The reason: I want to be able to refresh content therefore I need to keep settings somewhere, not update content on user actions and forget how I came to this state. My question is: what is the best place for such settings? Collection object? View object? My own controller?
P.S. to make it more clear, I'm working on rss reader application. And I want, for example, to show last week posts from certain feeds which are starred etc.
Save it in the URL. Thats the only place you can really rely on. If you need more then routes use query parameter like in a classic web application and use them in the view.