Django CMS - how views are created - django-cms

Im new to Django CMS and setting up a new project.
Would like to understand how the workflow works? I'm able to succesfully create a page and render it correctly but confused on how the views are created.

If you want custom views then you need to create your own applications which can be hooked in to CMS really easily.
Take a look at the docs; http://docs.django-cms.org/en/release-3.3.x/how_to/apphooks.html
Also, you can see an example of an application which can be integrated into CMS here; https://github.com/nephila/djangocms-blog/tree/develop/djangocms_blog

Related

Adding simple CMS functionality to an existing MVC application

ASP.NET 4.51, MVC 5
Have read Integrating a CMS into an established application-centric MVC website
We have a number of MVC applications that serve as public facing websites. The applications were built using MVC as that was the technology stack understood by the developers and primarily the content that was being delivered was based on business process data.
However more and more we are being asked to add "another page" to the websites which for all intents and purposes is a plain old static content page. This ultimately involves:
Adding a new route
Creating a view with the required HTML
We have various "home grown" solutions which now pull HTML from the database for these views. However this means we are writing custom back end data entry screens as well as 1 & 2 above.
So.... There must be a better way. Has anyone got any practical experience or suggestions on how to add simple CMS functionality that we can give to end users, plugged into our MVC application? We need to provide the following functionality to the end user:
Create new pages, edit pages using WYSIWYG
Add meta tags and canonical tags for SEO
Specify the url portion of the uri for SEO purposes
All insights appreciated.
Is it feasible to do the following:
Have a database table to house the content for these pages. e.g. title, summary, description, url, meta, image(s) etc...
In the front end have a template for these pages. The database data fills in the placeholders within this template.
Perhaps hold all the pages on a base URL like www.yoursite.com/page/dynamic-page-url-from-db
You can use the Remote attribute validation on the url field to make sure they are all unique in the database.
With this in mind, create a single Route to catch the requests and filter valid/invalid requests in the Page controller based on the URL provided with the db. If non-existent throw new HttpException(404, "Page Not Found"); and have an error handler pick that up and deliver your 404.
META could be set via ViewBag or a dedicated section that alters the _Layout file at the point of rendering the view.
TinyMCE is a decent WYSIWYG editor. You can even add dynamic image gallery functionality to it if you want to embed images within the main body of the pages.
I'm working on making a CMS currently used in a demanding production environment into a product. I've just (as of 20 Jan 2015) made a NuGet package which installs the CMS into an MVC project which should be possible to add to any existing MVC site without breaking it. CMS functionality can then be added where needed. Currently I'm looking to work with some users to help them get the CMS into production on their sites, however this may have changed by the time you read this. Look at http://www.lynicon.com for more information and to sign up to a Slack community where I can give you access to the NuGet package.

ASP.NET MVC AdminPanel and Front Section File Structure

I am working on this ASP.NET MVC Project to which i am very new.
I did some worked somehow on normal ASP.NET Web Forms back in days but i am really a beginner in ASP.NET. I developing projects in php for quite time and did never got a chance to try out .NET.
Back To Question:
I want to have two Sections, One for Administrators and One for Front End Users.
I want both Front End Users and Administrator(BackEnd) Users To have Different Themes Different Controller and Different Models.
In Simple PHP i did made base Controller Named My_Controller which extends the main Controller.
And after that i created two more base controllers derived from this my_controllers namely
AdminController
FrontEndController
and moved this based controllers to core directory or library directory.
But How to achieve such a thing in ASP.NET MVC, I am using ASP.NET MVC 5 at the moment.
Currently i just created new project using MVC. and Here below is the Current File Structure for my Project
Also Please Also Share what will be a better approach that making the base controllers for Admin Controller and FrontEnd Controller.
Or having Multiple MVC Projects in a project of a solution. Like HMVC.
But most importantly what is the best approach and how to achieve this admin and frontend file Structure.
Possible Solution 1:
The Good idea might be to use Area Feature of Asp.NET MVC. Area generally used for the purpose of sepration of user base, like in your case Public user and admin user.
Well explained details of area's can be found on following documentation.
http://msdn.microsoft.com/en-us/library/ee671793%28VS.100%29.aspx
Regarding the different themes for Admin and user web app, you can simply use different Layouts. Put two layout inside the View > Shared folder. Then specify layout on each view as below.
For User Views
Layout = "~/Views/Shared/_UserLayout.cshtml";
For Admin Views
Layout = "~/Views/Shared/_AdminLayout.cshtml";
Possible Solution 2:
if your project is big enough to think it will be difficult to handle the Areas later in a single project, you can also split the User and Admin project.
But you should be aware of re-usability of the source code by placing such code (such as Models) in other projects and adding reference.
I hope this solves your problem.

Is it possible to use Drupal to manage a static site?

Is it possible to use Drupal to manage a static site? I'd like to have a CMS like Drupal, but render a static site that would be moved to the server for serving. Drupal would not be running on the server. Is this possible with Drupal?
If you don't want a CMS generating dynamic pages, don't use one.
If you need to generate a static site from content easily editable, use a tool designed for this task. Like Sculpin, Phrozn, Jekyll (used by GitHub), Hyde, Bonsai, Webgen or Cyrax. But don't use a tools designed for completely different (and opposed) use cases. You will eventually needs something too specific and too static. Forcing you to implement complicated and un-intuitive logic to work around basic features of your (dynamic) CMS. You will eventually frustrate yourself or the next developer by forcing you/him/her to take the complex dynamic route to implement something that should be easily doable in a static site, only to have it statically exported later.
Use wget or a similar tool to create a static copy of your website. This works with any CMS, not just Drupal.
Regardless of my other answer, for static site generation using Drupal as backend, Zariz is probably worth looking at.
There is a new project that aims to do just that. It’s called Dekyll – Drupal on Jekyll.
Drupal is no doubt one of the best CMS out there; Jekyll is no doubt one of the best static site generators out there. See where I'm going? And it's no longer just a concept, it is a complete installation profile called Dekyll.
Despite the name another possibility is to use the MAG module (http://drupal.org/project/mag) (mobile app generator). It can create a basic static site out of a given menu.
This is usually enough for most basic uses cases.
I have not tried it, but new on the "market" is also the static module:
http://drupal.org/project/static

Creating DNN Portal through Code (or programming)?

I have one portal with 3 modules inside it, now my requirement is i would like to create
new portal for every client registered in my DNN site.
So, i have one interface for registration, so as soon as client registers entirely new parent portal should be created with all the modules.
How can i achieve this functionality ???
I would suggest digging into the admin files that come as part of the default DNN installation and look for the code that creates a new portal from there. It will ultimately be calling a stored procedure to create the necessary data in the SQL tables. You might get away with just calling the stored procs but the admin code probably calls several different ones to setup the default security settings.
Curiously what alias will each of these portals use? It's not clear why you need a complete portal for each user. The DNN segmentation already allows you to show different content based on role membership. Why the need for a whole portal per user?
Use the site wizard to create template of the current portal and during client registration programmatically execute the template. You may also want to automate the site setup in IIS.
Well, You can easily do it! Login to host and go to portals. Click on create new protal.
See which control is responsible for creating new portal. you can simaply get it by using firebug and look into client id of link or text box.
Once you do that, you will find the code you can use.
tell me if you need more help with it, I'm good with what you want to do!

Update asp.net Xml Sitemap

The project I am working allows users to create pages in a CMS type system.
I would like to use an asp.net sitemap to reference these pages. So when a page is added or moved the Xml sitemap would be updated.
Is this a practical solution and are there any solutions available that work similar to this?
You should probably write your own SiteMapProvider see http://msdn.microsoft.com/en-us/library/ms178431.aspx that loads from your CMS.

Resources