Button to create new page - django

I'm new to Mezzanine and django, in this moment I'm trying to make a button in a page template, the idea is to allow the registered user to do two things:
create a new daughter page of the current page
add an access link to a list of links of the current page
I would like to make a popup appear that asks for the name and content of the new page, I do not know if what I need is very complex to do with mezzanine, I study the djangogirls tutorial (tutorial.djangogirls.org) and I reviewed the examples of the mezzanine documentation (mezzanine.jupo.org/docs/content-architecture.html), but I do not see how to do what I need, this is the link for my mezzanine project: github.com/Dacastror/inicio_mezzanine
in advance I appreciate the help.

Related

Can I access my website from Django admin panel?

I am trying to develop a website where I can see the homepage as it is from Django admin panel. The reason I want that is I want to edit the name of the static content like 'Home' to 'All' along with the change of slide show picture. In summary, I want to change the website layout from Django admin panel that is not accessible to users. Is that possible? I just want an idea of how to implement the process.
Static texts you can change in admin panel with different modules:
for example django-rosetta or my own library Django-tof. https://github.com/wP-soft-GmbH/django-tof
But in your case, i think, you want to made something more.
For this case you can use django-flat-pages, already included in Django, if you have a static web-page.
you can edit every element on the page and after save, you can see it on the front.
if you really want to change the django templates, which you use in your views, you can create a simple template editor in the admin panel based on a widget like django-Ckeditor.

Solution To create or update static pages in Django

How can I create interface or solution to the website owner to be able to create or update static pages in Django without open source code, for example, a website owner needs to update text in aboutus page or want to create a new static page like new promotion details.
If I understood you correctly you want to allow user to update the text or add new page dynamically. If so you can go for Django content management system you can use django mezzanine. https://www.digitalocean.com/community/tutorials/how-to-install-and-get-started-with-django-based-mezzanine-cms-on-ubuntu

Add app model in new Page by drop-down select in Django

It is bit complicated so I hope that explain this properly.
I have app which is created within new Page in admin site. In that app I have also drop-down list with my installed apps like on picture.
drop-down of installed apps in new Page
I need someway to add models of selected app dynamicaly by add button at the end of this Page. So if I select app, with add button add model of app below page content, next select second app and add model below app added before. So at the end I will have filled Page with models of apps that I added.
Adding functionality like on this picture or with some add button or add button next to drop-down.
desired functionality
I dont have so much experiences in Django that I can make it self right now. I know that this is possible but I need help of you that you are Django Pro. I really need to make this done.

adding custom page's link in homepage in opencart

I am new in opencart, and I am trying to build a new eCommerce site using opencart where I need to add some custom static page ( some additional page ). So I follow the link New Page For OpenCart and opencart php custom page without using the "information" feature, and I can create a new custom page. But my problem is, how can I get this page's link on my home and others page so that people view my page.
If you are creating a new page that way, you will be to access the page (called "newpage" for example) at: /index.php?route=common/newpage or /index.php?route=common/home/newpage depending how you set it up.
The simplest way of creating a new page is to create a new information page. You can input your custom html there if needs be. The link would then look like:
/index.php?route=information/information&information_id=x where the id is the id of your new page.
To add this link into your main menu you can edit template/common/header.tpl and hardcode in the new link.
Creating your link would depend greatly on how the page has been created, and where it's located.
Urls are built based on the location ie: route of your controller.
Let's say your new page has been built in:
catalog/controller/common/mypage.php
Obviously you'll need to follow the code standards listed in the posts you referenced for created a correct class that extends the Controller, a language file, a model class (if your page needs to interact with the database) and a view file.
Once all that is correct via the previous posts you can create a link anywhere on the catalog (front) by calling the url class and passing in the required information.
You'll need to pass in a route, any arguments such as an id or customer, and whether the url should be secure.
$link = $this->url->link('common/mypage', 'mypage_id=' . $this->request->get['mypage_id'], 'SSL');
$arguments and 'SSL' being optional if they're needed.

Integrate existing blog code into Django-CMS?

If I already have a blog app done with Django and I want to use it with my new Django CMS site, is it okay to simply drop it into my new Django CMS project as a decoupled app and match anything /blog/ to the blog app as apposed to a Django CMS plugin? I guess what I need to know is when is it best to write my Django app as a plugin vs an entire app?
Thx
JeffC
Yes, but you don't just drop it into the urls.py, instead you can write an AppHook to tie your blog's URL scheme to a particular page in your CMS.
Plugins on the other hand are useful if you want to inserts particular aspects of you app into other page's placeholders - for example to show your latest 3 posts on the frontpage.
You might also want to include your blog's paths in a breadcrumb or menu on your site - in that case you need to write a custom Menu too.
Finally, it might also be useful to make use of django cms's placeholders in you blog model. His would allow you to post a variety of content via plugins.